bash-lsp / bash-language-server

A language server for Bash
MIT License
2.14k stars 123 forks source link

Neovim: client quit with exit code 1 and signal 0 #1021

Closed rickywu closed 2 weeks ago

rickywu commented 1 year ago

Code editor

Neovim

Platform

Windows

Version

5.0.0

What steps will reproduce the bug?

Install bashls by Mason in Neovim, package all the runtime include nvim and nvim-data to another offline system and open shell script got error the runtime include neovim nvim-data nvim dots, nodejs, python and compilers, keep the same.

How often does it reproduce? Is there a required condition?

stoped after start 1st time

What is the expected behavior?

bashls should be one lsp running in neovmim

What do you see instead?

client quit with exit code 1 and signal 0 LspLog:

[ERROR][2023-11-02 13:01:54] .../vim/lsp/rpc.lua:734 "rpc" "d:\\DevTools\\Neovim\\nvim-data\\mason\\bin\\bash-language-server.CMD" "stderr" "d:\\DevTools\\Neovim\\nvim-data\\mason\\packages\\bash-language-server\\node_modules\\bash-language-server\\node_modules\\vscode-jsonrpc\\lib\\common\\linkedMap.js:40\r\n return this._head?.value;\r\n ^\r\n\r\nSyntaxError: Unexpected token .\r\n at Module._compile (internal/modules/cjs/loader.js:721:23)\r\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)\r\n at Module.load (internal/modules/cjs/loader.js:653:32)\r\n at tryModuleLoad (internal/modules/cjs/loader.js:593:12)\r\n at Function.Module._load (internal/modules/cjs/loader.js:585:3)\r\n at Module.require (internal/modules/cjs/loader.js:690:17)\r\n at require (internal/modules/cjs/helpers.js:25:18)\r\n at Object.<anonymous> (d:\\DevTools\\Neovim\\nvim-data\\mason\\packages\\bash-language-server\\node_modules\\bash-language-server\\node_modules\\vscode-jsonrpc\\lib\\common\\api.js:37:21)\r\n at Module._compile (internal/modules/cjs/loader.js:776:30)\r\n at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)\r\n"

Additional information

The env which installed by mason works well also null-ls installed by mason works well, but bashls exited

underwoodtan commented 1 year ago

Please ensure you have node version 16 or newer (node --version).

rickywu commented 1 year ago

I'm using node 20.x

spacegaucho commented 2 weeks ago

This issue should probably be closed since there was no more replies from OP. For completion I figured out how to fix a very similar issue. The problem (in my case) was related to different versions of node being installed at the same time.

Neovim was finding one older version which I had installed via nvm (node version manager). After installing the latest version and deleting ~/.nvm/ everything started working again.