Install not working

#1

I am trying to install Vapid and the commands npm install -g vapid-cli or sudo npm install -g vapid-cli is not working. Error:stack: 'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\''

I followed instructions from this entry and this entry, but no luck from either.

stack: 'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\''

I am on MacOS. Please help I just wanna try Vapiddd! Thank you in advance

#2

@dearnaomichan I think this article might be helpful: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally

Can't install via npm install -g @vapid/cli
#3

try installing Node through nvm, it usually gets rid of those pesky permissions issues when installing packages globally

#4

EDIT: This post solved my issue:
Sudo npm install -g vapid-cli NOT WORKING

I have Node (11.0.4) installed through n (https://github.com/tj/n)
Still seeing the same results as OP when trying to install vapid-cli

[root@]# npm install -g vapid-cli
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
/usr/local/bin/vapid -> /usr/local/lib/node_modules/vapid-cli/bin/cli.js

bcrypt@2.0.1 install /usr/local/lib/node_modules/vapid-cli/node_modules/bcrypt
node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Pre-built binaries not installable for bcrypt@2.0.1 and node@11.4.0 (node-v67 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Hit error EACCES: permission denied, mkdir ‘/usr/local/lib/node_modules/vapid-cli/node_modules/bcrypt/lib’
gyp WARN EACCES user “root” does not have permission to access the dev dir “/root/.node-gyp/11.4.0”
gyp WARN EACCES attempting to reinstall using temporary dev dir “/usr/local/lib/node_modules/vapid-cli/node_modules/bcrypt/.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/local/lib/node_modules/vapid-cli/node_modules/bcrypt/.node-gyp’
gyp ERR! System Linux 3.10.0-693.17.1.el7.x86_64
gyp ERR! command “/usr/local/bin/node” “/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “configure” “–fallback-to-build” “–module=/usr/local/lib/node_modules/vapid-cli/node_modules/bcrypt/lib/binding/bcrypt_lib.node” “–module_name=bcrypt_lib” “–module_path=/usr/local/lib/node_modules/vapid-cli/node_modules/bcrypt/lib/binding” “–napi_version=3” “–node_abi_napi=napi”
gyp ERR! cwd /usr/local/lib/node_modules/vapid-cli/node_modules/bcrypt
gyp ERR! node -v v11.4.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute ‘/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/vapid-cli/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/usr/local/lib/node_modules/vapid-cli/node_modules/bcrypt/lib/binding --napi_version=3 --node_abi_napi=napi’ (1)
node-pre-gyp ERR! stack at ChildProcess. (/usr/local/lib/node_modules/vapid-cli/node_modules/bcrypt/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:189:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:978:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
node-pre-gyp ERR! System Linux 3.10.0-693.17.1.el7.x86_64
node-pre-gyp ERR! command “/usr/local/bin/node” “/usr/local/lib/node_modules/vapid-cli/node_modules/bcrypt/node_modules/.bin/node-pre-gyp” “install” “–fallback-to-build”
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/vapid-cli/node_modules/bcrypt
node-pre-gyp ERR! node -v v11.4.0
node-pre-gyp ERR! node-pre-gyp -v v0.9.1
node-pre-gyp ERR! not ok
Failed to execute ‘/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/vapid-cli/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/usr/local/lib/node_modules/vapid-cli/node_modules/bcrypt/lib/binding --napi_version=3 --node_abi_napi=napi’ (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/vapid-cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bcrypt@2.0.1 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt@2.0.1 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! /root/.npm/_logs/2018-12-13T17_07_18_000Z-debug.log