Closed rafi closed 4 years ago
bash-language-server
does not install on node 12.x.
Reference:
just a reminder: this is no longer the case apparently. they have updated bash-language-server. also there is some solution for node-tree-sitter.
@dagadbm I'm still getting the problem though.
To fix manually, simply install bash-language-server
where coc is trying to find it. So in my case, it was looking for it somewhere in the ~/.config/coc/sh/tools/node_modules
directory. You can double check this by looking at the :CocOpenLog
and see where it tried to find the language server.
In that directory (~/.config/coc/sh/tools
), run yarn add bash-language-server
. Tada, it works correctly. Not sure why the extension isn't actually installing it.
Finally was able to get an actual printout of the installation logs (see junegunn/vim-plug/#910):
yarn install v1.19.1
[1/5] Validating package.json...
warning coc-sh@0.2.1: The engine "coc" appears to be invalid.
[2/5] Resolving packages...
[3/5] Fetching packages...
[4/5] Linking dependencies...
[5/5] Building fresh packages...
$ yarn clean && yarn build
yarn run v1.19.1
warning coc-sh@0.2.1: The engine "coc" appears to be invalid.
$ rimraf lib
Done in 0.20s.
yarn run v1.19.1
warning coc-sh@0.2.1: The engine "coc" appears to be invalid.
$ tsc -p tsconfig.json
Done in 2.45s.
Done in 9.88s.
I'm not familiar with how it is supposed to work, but it looks like it doesn't even attempt to install the bash-language-server.
This should be resolved in v0.3.1
. Please reopen if installation still fails.
This works ok if coc-sh is installed the way 'CocInstall' installs it. However if you have a 'package.json' which lists 'coc-sh' and you perform a 'npm install' or 'yarn install' the bash-language-server will not necessary be installed under the 'coc-sh/node_modules' directory as the code assumes.
i.e this line: https://github.com/josa42/coc-sh/blob/master/src/extension.ts#L56 is making an incorrect assumption on how node modules are installed by tools other than CocInstall.
I personally perform a 'yarn install' instead of 'CocInstall' as I use a cache directory for doing the install which CocInstall doesn't expose. It also does a more efficient installation than what CocInstall does.
It would be great if this extension could determine the path to 'bash-language-server' by walking up the tree looking into 'node_modules' directories the same way nodejs resolves required dependencies.
This package may help with the resolution using nodejs resolution strategy:
Installing
coc-sh
withCocInstall
fails with node v12.5.0 npm 6.9.0 yarn 1.17.0 on macOS 10.14.5, click below to see install log:npm install log
The
package.json
dependencies are pretty old, maybe some updates would do some good?