bash-language-server: Install error Failed at the tree-sitter@0.13.23 install script

I’m getting an error when trying to install as root with npm install -g bash-language-server, here is the log from /root/.npm/_logs/*.log (after the successful dependencies installations):

4873 silly install tree-sitter@0.13.23
4874 info lifecycle tree-sitter@0.13.23~install: tree-sitter@0.13.23
4875 verbose lifecycle tree-sitter@0.13.23~install: unsafe-perm in lifecycle false
4876 verbose lifecycle tree-sitter@0.13.23~install: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/lib/node_modules/bash-language-server/node_modules/tree-sitter/node_modules/.bin:/usr/lib/node_modules/bash-language-server/node_modules/.bin:/usr/lib/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/android-sdk/platform-tools:/opt/android-sdk/tools:/opt/android-sdk/tools/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
4877 verbose lifecycle tree-sitter@0.13.23~install: CWD: /usr/lib/node_modules/bash-language-server/node_modules/tree-sitter
4878 silly lifecycle tree-sitter@0.13.23~install: Args: [ '-c', 'prebuild-install || node-gyp rebuild' ]
4879 silly lifecycle tree-sitter@0.13.23~install: Returned: code: 1  signal: null
4880 info lifecycle tree-sitter@0.13.23~install: Failed to exec install script
4881 timing action:install Completed in 418ms
4882 verbose unlock done using /root/.npm/_locks/staging-a072192f34a17023.lock for /usr/lib/node_modules/.staging
4883 timing stage:rollbackFailedOptional Completed in 267ms
4884 timing stage:runTopLevelLifecycles Completed in 50001ms
4885 verbose stack Error: tree-sitter@0.13.23 install: `prebuild-install || node-gyp rebuild`
4885 verbose stack Exit status 1
4885 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
4885 verbose stack     at EventEmitter.emit (events.js:182:13)
4885 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
4885 verbose stack     at ChildProcess.emit (events.js:182:13)
4885 verbose stack     at maybeClose (internal/child_process.js:978:16)
4885 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
4886 verbose pkgid tree-sitter@0.13.23
4887 verbose cwd /root
4888 verbose Linux 4.19.2-arch1-1-ARCH
4889 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "bash-language-server"
4890 verbose node v11.2.0
4891 verbose npm  v6.4.1
4892 error code ELIFECYCLE
4893 error errno 1
4894 error tree-sitter@0.13.23 install: `prebuild-install || node-gyp rebuild`
4894 error Exit status 1
4895 error Failed at the tree-sitter@0.13.23 install script.
4895 error This is probably not a problem with npm. There is likely additional logging output above.
4896 verbose exit [ 1, true ]

I’ve encountered a similar issue here: https://github.com/banacorn/language-agda/issues/15 but it happened on a Windows machine and I use Arch Linux.

Any ideas? Thanks.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 29 (6 by maintainers)

Commits related to this issue

Most upvoted comments

Update: This fixed the issue here on Arch Linux along with --unsafe-perm: https://wiki.archlinux.org/index.php/Node.js#node-gyp_python_errors

Well done Arch Wiki, you did it again. Cheers.

Note that python is not used as a direct dependency here, but node-gyp is the issue here.

A section in the README with details on resolving install issues would be very appreciated.

Related: https://github.com/nodejs/node-gyp/blob/master/README.md#configuring-python-dependency

We have just released a new version of bash-language-server (1.6.0) that:

  • supports node > 8 (including 12)
  • should remove all installation issues caused by node-gyp and native bindings

To upgrade run:

npm i -g bash-language-server

Let us know if this works for you. Thanks 😃

Ok thanks, it works with v10. Maybe this could be mentioned in the README, it would have saved me some trial and error.

@sbrl those issue are not related. What you see is a permission issue with your npm and node installation.

There are several guides online on how to solve that. Official documentation might be a good start: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally

Hi @doronbehar It seems that bash-language-server isn’t compatible with nodejs-lts-carbon version 8.13.0. Install nodejs version 11.3.0 (sudo pacman -S nodejs) and all seems work when you use bash-language-server start. You could also install bash-language-server from community repo (sudo pacman -S bash-language-server). I am going to write a comment at https://www.archlinux.org/packages/community/x86_64/bash-language-server/ and post an issue at https://github.com/tree-sitter/tree-sitter/issues

@mads-hartmann could you add in your package.json { "engines" : { "node" : ">=11.3.0" } } (or other relevant version) and type command npm config set engine-strict true (see https://stackoverflow.com/questions/29349684/how-can-i-specify-the-required-node-js-version-in-packages-json).

Thanks in advance ! 😉