Closed OZoneGuy closed 1 year ago
Can you run npm --version
in a terminal?
If not, you may not have node.js installed.
Node.js is used to install both typescript and ts-ls, so you'll need to install it first if you don't already have it.
npm --version
9.6.7
And here are the global packages:
npm list -g
/home/omar/.local/share/nvm/v20.3.0/lib
├── @volar/vue-language-server@1.6.5
├── corepack@0.18.0
├── eslint@8.43.0
├── npm@9.6.7
├── prettier@2.8.8
├── typescript-formatter@7.2.2
├── typescript-language-server@3.3.2
└── typescript@5.1.3
npm
and node
are installed via nvm
. And Emacs can use that npm install, it is the only install in the system.
Now, it is not detecting npm nor node. Even though they are installed and running on the system
which node
/home/omar/.local/share/nvm/v20.3.0/bin/node
Is there a config that I am missing?
Last resort. Set the environment variable for the default node version, then reinstalled spacemacs. That solved it.
Not entirely sure what was going on.
Sounds like the PATH
variable in .spacemacs.env
was missing the path to npm
and so it was not found from within emacs. Reinstalling may've recreated .spacemacs.env
with an updated PATH
If you have this issue and suspect it's because you installed node on your system via NPM, this fixed it for me:
Edit ~/.spacemacs.env
Add your nvm directory to the PATH
environment variable in ~/.spacemacs.env
It's probably like
/home/USERNAME/.nvm/versions/node/v18.17.0/bin
You can find out your specific version by doing echo $PATH
and seeing what your nvm path looks like
Last resort. Set the environment variable for the default node version, then reinstalled spacemacs. That solved it.
Not entirely sure what was going on.
How do you do that? Because I use fish also and jorge Bucaramn nvm/fish
Description :octocat:
Typescript LSP fails to installs on a fresh spacemacs install.
Reproduction guide :beetle:
ts-ls
as the server to install when prompted (or attempt to install it vialsp-install-server
)Observed behaviour: :eyes: :broken_heart: Returns with the error:
And produces the following messages:
Expected behaviour: :heart: :smile: Install the LSP without any issues
System Info :computer:
NOTE :eyes:
I am using nvm with fish shell. The locations for the nvm data is different than other posix shells. I added the nvm environment variables to
.spacemacs.env
.I couldn't find information on this issue. If someone knows a workaround or a solution, let me know. Thanks.