Skip to content

Can't install on ubuntu 18.04 #82

Closed
@Lenbok

Description

@Lenbok

I'm not familiar with npm but your installation instructions looked easy. However I am getting errors when trying to install the bash language server on ubuntu 18.04. (my eventual goal is to try using this via the emacs lsp-sh mode)

Running the stated installation command gives:

[tree of packages to install]
npm ERR! Linux 4.4.0-134-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "i" "-g" "bash-language-server"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! path /usr/local/lib
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access

npm ERR! Error: EACCES: permission denied, access '/usr/local/lib'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES: permission denied, access '/usr/local/lib']
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/len/npm-debug.log

Running as administrator doesn't help:

$ sudo npm i -g bash-language-server
loadDep:lodash            | |##################################################---------------------------------------------------------------------------------------------------------------------------------------------------|
loadDep:tr46 -> request   \ |##############################################################---------------------------------------------------------------------------------------------------------------------------------------|
loadDep:vscode-languagese \ |######################################################################-------------------------------------------------------------------------------------------------------------------------------|
/usr/local/bin/bash-language-server -> /usr/local/lib/node_modules/bash-language-server/bin/main.js

> tree-sitter-bash@0.13.3 install /usr/local/lib/node_modules/bash-language-server/node_modules/tree-sitter-bash
> prebuild-install || node-gyp rebuild

/usr/bin/env: ‘node’: No such file or directory
/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' returned exit status 127 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:354:16)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.4.0-134-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/bash-language-server/node_modules/tree-sitter-bash
gyp ERR! node -v v4.2.6
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
/usr/local/lib
`-- (empty)

npm ERR! Linux 4.4.0-134-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "i" "-g" "bash-language-server"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE

npm ERR! tree-sitter-bash@0.13.3 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the tree-sitter-bash@0.13.3 install script 'prebuild-install || node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the tree-sitter-bash package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     prebuild-install || node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs tree-sitter-bash
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls tree-sitter-bash
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/len/npm-debug.log
npm ERR! code 1

Looks like 18.04 node may be too old. After updating nodejs to the latest it still doesn't work:

$ sudo npm i -g bash-language-server
/usr/bin/bash-language-server -> /usr/lib/node_modules/bash-language-server/bin/main.js

> tree-sitter@0.13.15 install /usr/lib/node_modules/bash-language-server/node_modules/tree-sitter
> prebuild-install || node-gyp rebuild

prebuild-install WARN install EACCES: permission denied, mkdir '/usr/lib/node_modules/bash-language-server/node_modules/tree-sitter/build'
gyp WARN EACCES user "root" does not have permission to access the dev dir "/home/len/.node-gyp/10.11.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/bash-language-server/node_modules/tree-sitter/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/bash-language-server/node_modules/tree-sitter/.node-gyp'
gyp ERR! System Linux 4.4.0-134-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/bash-language-server/node_modules/tree-sitter
gyp ERR! node -v v10.11.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! tree-sitter@0.13.15 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the tree-sitter@0.13.15 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/len/.npm/_logs/2018-10-02T20_51_16_481Z-debug.log

Please help?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions