Skip to content

Commit

Permalink
fix(graphql): do not execute npm-install-peers
Browse files Browse the repository at this point in the history
What
===

It is revert [Pull npm peerDependencies as required by elken · Pull Request #3511 · emacs-lsp/lsp-mode](#3511).

Why
===

When I run `npm-install-peers` in the `graphql-language-service-cli` directory, oddly enough, the `graphql-language-service` disappears from `node_modules` as a result of dependency resolution.
As a result, the graphql language server does not work at all.
From the PR I linked to, it seems that the mechanism to run `npm-install-peers` was originally put in for graphql.
Maybe if it was a previous version, it would rather not work without installing it.
Since simpler things are preferable, I removed the `npm-install-peers` execution.
  • Loading branch information
ncaq committed Feb 14, 2025
1 parent ad38dab commit 236e1f2
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions lsp-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -8384,18 +8384,7 @@ nil."
;; https://github.com/emacs-lsp/lsp-mode/issues/2364 for
;; discussion.
(make-directory (f-join lsp-server-install-dir "npm" package "lib") 'parents)
(lsp-async-start-process (lambda ()
(if (string-empty-p
(string-trim (shell-command-to-string
(mapconcat #'shell-quote-argument `(,npm-binary "view" ,package "peerDependencies") " "))))
(funcall callback)
(let ((default-directory (f-dirname (car (last (directory-files-recursively (f-join lsp-server-install-dir "npm" package) "package.json")))))
(process-environment (append '("npm_config_yes=true") process-environment))) ;; Disable prompting for older versions of npx
(when (f-dir-p default-directory)
(lsp-async-start-process callback
error-callback
(executable-find "npx")
"npm-install-peers")))))
(lsp-async-start-process callback
error-callback
npm-binary
"-g"
Expand Down

0 comments on commit 236e1f2

Please sign in to comment.