vim-lsp-settings icon indicating copy to clipboard operation
vim-lsp-settings copied to clipboard

Couldn't find 'tsserver' executable or 'tsserver.js' module

Open jsit opened this issue 5 years ago • 4 comments

Failed to initialize typescript-language-server with error -32603: Request initialize failed with message: Couldn't find 'tsserver' executable or 'tsserver.js' module

I ran the installation as described in README.md, yet am getting this error. How do I solve it?

jsit avatar Jul 14 '20 18:07 jsit

I realize this is because I didn't install typescript globally:

https://github.com/prabirshrestha/vim-lsp/wiki/Servers-JavaScript

Shouldn't this be handled by :LspInstallServer?

jsit avatar Jul 14 '20 18:07 jsit

@jsit

:LspInstallServer already has the typescript (tsserver) package installed and the tsserver command in it.

See: https://github.com/mattn/vim-lsp-settings/blob/master/installer/install-typescript-language-server.sh

vim-lsp-settings prioritizes commands on the system's PATH.

If you have installed typescript-language-server globally, the global side of typescript-language-server will be invoked.

In that case, you need to install typescript globally and the tsserver module needs to be present.

Also, tsserver local to the project is fine.

yaegassy avatar Jul 25 '20 01:07 yaegassy

run npm i -g typescript typescript-language-server

winkee01 avatar Sep 21 '20 12:09 winkee01

Is there a reason why typescript-language-server is used instead of directly using tsserver?

diamondburned avatar Jun 09 '23 02:06 diamondburned