Tsserver doesn't work on windows

This is the error i got

cmd ["typescript-language-server.cmd"] is not executable.
cmd ["typescript-language-server.cmd"] is not executable.

My config:

-- js/typescript
require'lspconfig'.tsserver.setup{
    cmd = { "typescript-language-server.cmd", "--stdio" },
    capabilities = capabilities,
    filetypes = { "javascript", "javascriptreact", "javascript.jsx", "typescript", "typescriptreact", "typescript.tsx" }
}

I have tried adding the .cmd but it doesn’t work. I installed the typescript typescript-language-server

vscode-language-servers-extracted does not provide tsserver. Did you read the typescript-language-server section in server_configurations.md?

npm install -g typescript typescript-language-server

Sorry type wrongly ahaha. I installed that

Ok, now what happens if you type typescript-language-server --stdio or typescript-language-server.cmd --stdio directly into powershell?

:rocket: typescript-language-server.cmd --stdio
typescript-language-server.cmd : The term ‘typescript-language-server.cmd’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that
the path is correct and try again.
At line:1 char:1

  • typescript-language-server.cmd --stdio
  •   + CategoryInfo          : ObjectNotFound: (typescript-language-server.cmd:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException

Ok, what about without .cmd now

:rocket: typescript-language-server --stdio
typescript-language-server : The term ‘typescript-language-server’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path
is correct and try again.
At line:1 char:1

  • typescript-language-server --stdio
  •   + CategoryInfo          : ObjectNotFound: (typescript-language-server:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException

Ok, there’s your issue. Typescript-language-server is not on your path, there’s no way neovim can launch it.

How am i going to add it? I installed it…

Well, you can consult general Windows documentation on how to add things to your PATH.

All I did was:

  1. Install winget
  2. winget install nodejs
  3. npm i -g typescript typescript-language-server
  4. restart powershell
  5. typescript-language-server.cmd --stdio

on a fresh windows VM and everything worked as expected.


as you can see the npm stuff on top is running.

my path:
image

HOLY COW SEE THIS:

I don’t understand the content of your last post

I added the path and install tsserver. Whenever i open cmd… there is npm install prefix@latest. that happends after i add the path

Ok, does it work now?

Ya but the npm thing is bugging me

I don’t know what the “npm thing” is