Can't run npm install

Error

➜  online-test-api git:(master) ✗ npm install firebase
npm ERR! code EPERM
npm ERR! errno EPERM
npm ERR! FetchError: request to https://registry.npmjs.org/firebase failed, reason: connect EPERM 104.16.23.35:443 - Local (0.0.0.0:0)
npm ERR!     at ClientRequest.<anonymous> (/Users/ba-00011110/.nvm/versions/node/v12.18.4/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:68:14)
npm ERR!     at ClientRequest.emit (events.js:315:20)
npm ERR!     at TLSSocket.socketErrorListener (_http_client.js:426:9)
npm ERR!     at TLSSocket.emit (events.js:315:20)
npm ERR!     at emitErrorNT (internal/streams/destroy.js:92:8)
npm ERR!     at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
npm ERR!     at processTicksAndRejections (internal/process/task_queues.js:84:21)
npm ERR!  FetchError: request to https://registry.npmjs.org/firebase failed, reason: connect EPERM 104.16.23.35:443 - Local (0.0.0.0:0)
npm ERR!     at ClientRequest.<anonymous> (/Users/ba-00011110/.nvm/versions/node/v12.18.4/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:68:14)
npm ERR!     at ClientRequest.emit (events.js:315:20)
npm ERR!     at TLSSocket.socketErrorListener (_http_client.js:426:9)
npm ERR!     at TLSSocket.emit (events.js:315:20)
npm ERR!     at emitErrorNT (internal/streams/destroy.js:92:8)
npm ERR!     at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
npm ERR!     at processTicksAndRejections (internal/process/task_queues.js:84:21) {
npm ERR!   type: 'system',
npm ERR!   errno: 'EPERM',
npm ERR!   code: 'EPERM'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ba-00011110/.npm/_logs/2021-03-08T04_24_07_318Z-debug.log
➜  online-test-api git:(master) ✗

Operating system and version:

MacOS Mojave 10.14.6

nvm debug output:

➜  online-test-api git:(master) ✗ nvm debug
nvm --version: v0.37.2
$TERM_PROGRAM: iTerm.app
$SHELL: /bin/zsh
$SHLVL: 1
whoami: 'ba-00011110'
${HOME}: /Users/ba-00011110
${NVM_DIR}: '${HOME}/.nvm'
${PATH}: ${NVM_DIR}/versions/node/v12.18.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Visual Studio Code.app/Contents/Resources/app/bin:/Applications/Sublime Text.app/Contents/SharedSupport/bin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:${HOME}/Library/Android/sdk/platform-tools:${HOME}/.composer/vendor/bin:${HOME}/.symfony/bin
$PREFIX: ''
${NPM_CONFIG_PREFIX}: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'zsh 5.3 (x86_64-apple-darwin18.0)'
uname -a: 'Darwin 18.7.0 Darwin Kernel Version 18.7.0: Tue Jan 12 22:04:47 PST 2021; root:xnu-4903.278.56~1/RELEASE_X86_64 x86_64'
checksum binary: 'shasum'
OS version: Mac 10.14.6 18G8022
curl: /usr/bin/curl, curl 7.54.0 (x86_64-apple-darwin18.0) libcurl/7.54.0 LibreSSL/2.6.5 zlib/1.2.11 nghttp2/1.24.1
wget: /usr/local/bin/wget, GNU Wget 1.20.3 built on darwin18.7.0.
sed: /usr/bin/sed
cut: /usr/bin/cut
basename: /usr/bin/basename
rm: /bin/rm
mkdir: /bin/mkdir
xargs: /usr/bin/xargs
git: /usr/bin/git, git version 2.21.1 (Apple Git-122.3)
ls: grep:: No such file or directory
grep: grep: aliased to grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,.tox} (grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn,.idea,.tox}), grep (BSD grep) 2.5.1-FreeBSD
awk: /usr/bin/awk, awk version 20070501
nvm current: v12.18.4
which node: ${NVM_DIR}/versions/node/v12.18.4/bin/node
which iojs: iojs not found
which npm: ${NVM_DIR}/versions/node/v12.18.4/bin/npm
npm config get prefix: ${NVM_DIR}/versions/node/v12.18.4
npm root -g: ${NVM_DIR}/versions/node/v12.18.4/lib/node_modules
➜  online-test-api git:(master) ✗

npm debug log output:

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/Users/ba-00011110/.nvm/versions/node/v12.18.4/bin/node',
1 verbose cli   '/Users/ba-00011110/.nvm/versions/node/v12.18.4/bin/npm',
1 verbose cli   'install'
1 verbose cli ]
2 info using npm@6.14.6
3 info using node@v12.18.4
4 verbose npm-session a97f2ad8de217ad0
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall online-test-api@1.0.0
7 info lifecycle online-test-api@1.0.0~preinstall: online-test-api@1.0.0
8 silly install loadCurrentTree
9 silly install readLocalPackageData
10 timing stage:loadCurrentTree Completed in 7ms
11 silly install loadIdealTree
12 silly install cloneCurrentTreeToIdealTree
13 timing stage:loadIdealTree:cloneCurrentTree Completed in 0ms
14 silly install loadShrinkwrap
15 timing stage:loadIdealTree:loadShrinkwrap Completed in 1ms
16 silly install loadAllDepsIntoIdealTree
17 silly fetchPackageMetaData error for nodemon@^2.0.7 request to https://registry.npmjs.org/nodemon failed, reason: connect EPERM 104.16.24.35:443 - Local (0.0.0.0:0)
18 silly fetchPackageMetaData error for fastify-swagger@^4.3.1 request to https://registry.npmjs.org/fastify-swagger failed, reason: connect EPERM 104.16.24.35:443 - Local (0.0.0.0:0)
19 silly fetchPackageMetaData error for fastify@^3.12.0 request to https://registry.npmjs.org/fastify failed, reason: connect EPERM 104.16.24.35:443 - Local (0.0.0.0:0)
20 silly fetchPackageMetaData error for boom@^7.3.0 request to https://registry.npmjs.org/boom failed, reason: connect EPERM 104.16.24.35:443 - Local (0.0.0.0:0)
21 silly fetchPackageMetaData error for mongoose@^5.11.18 request to https://registry.npmjs.org/mongoose failed, reason: connect EPERM 104.16.24.35:443 - Local (0.0.0.0:0)
22 silly fetchPackageMetaData error for boom@^7.3.0 request to https://registry.npmjs.org/boom failed, reason: connect EPERM 104.16.24.35:443 - Local (0.0.0.0:0)
23 silly fetchPackageMetaData error for fastify@^3.12.0 request to https://registry.npmjs.org/fastify failed, reason: connect EPERM 104.16.24.35:443 - Local (0.0.0.0:0)
24 silly fetchPackageMetaData error for mongoose@^5.11.18 request to https://registry.npmjs.org/mongoose failed, reason: connect EPERM 104.16.24.35:443 - Local (0.0.0.0:0)
25 timing stage:rollbackFailedOptional Completed in 0ms
26 timing stage:runTopLevelLifecycles Completed in 87ms
27 silly saveTree online-test-api@1.0.0
28 verbose type system
29 verbose stack FetchError: request to https://registry.npmjs.org/boom failed, reason: connect EPERM 104.16.24.35:443 - Local (0.0.0.0:0)
29 verbose stack     at ClientRequest.<anonymous> (/Users/ba-00011110/.nvm/versions/node/v12.18.4/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:68:14)
29 verbose stack     at ClientRequest.emit (events.js:315:20)
29 verbose stack     at TLSSocket.socketErrorListener (_http_client.js:426:9)
29 verbose stack     at TLSSocket.emit (events.js:315:20)
29 verbose stack     at emitErrorNT (internal/streams/destroy.js:92:8)
29 verbose stack     at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
29 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:84:21)
30 verbose cwd /Users/ba-00011110/Projects/Nodejs/online-test-api
31 verbose Darwin 18.7.0
32 verbose argv "/Users/ba-00011110/.nvm/versions/node/v12.18.4/bin/node" "/Users/ba-00011110/.nvm/versions/node/v12.18.4/bin/npm" "install"
33 verbose node v12.18.4
34 verbose npm  v6.14.6
35 error code EPERM
36 error errno EPERM
37 error FetchError: request to https://registry.npmjs.org/boom failed, reason: connect EPERM 104.16.24.35:443 - Local (0.0.0.0:0)
37 error     at ClientRequest.<anonymous> (/Users/ba-00011110/.nvm/versions/node/v12.18.4/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:68:14)
37 error     at ClientRequest.emit (events.js:315:20)
37 error     at TLSSocket.socketErrorListener (_http_client.js:426:9)
37 error     at TLSSocket.emit (events.js:315:20)
37 error     at emitErrorNT (internal/streams/destroy.js:92:8)
37 error     at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
37 error     at processTicksAndRejections (internal/process/task_queues.js:84:21)
37 error  FetchError: request to https://registry.npmjs.org/boom failed, reason: connect EPERM 104.16.24.35:443 - Local (0.0.0.0:0)
37 error     at ClientRequest.<anonymous> (/Users/ba-00011110/.nvm/versions/node/v12.18.4/lib/node_modules/npm/node_modules/node-fetch-npm/src/index.js:68:14)
37 error     at ClientRequest.emit (events.js:315:20)
37 error     at TLSSocket.socketErrorListener (_http_client.js:426:9)
37 error     at TLSSocket.emit (events.js:315:20)
37 error     at emitErrorNT (internal/streams/destroy.js:92:8)
37 error     at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
37 error     at processTicksAndRejections (internal/process/task_queues.js:84:21) {
37 error   type: 'system',
37 error   errno: 'EPERM',
37 error   code: 'EPERM',
37 error   parent: 'online-test-api'
37 error }
38 error The operation was rejected by your operating system.
38 error It is likely you do not have the permissions to access this file as the current user
38 error
38 error If you believe this might be a permissions issue, please double-check the
38 error permissions of the file and its containing directories, or try running
38 error the command again as root/Administrator.
39 verbose exit [ 1, true ]

nvm ls output:

➜  online-test-api git:(master) ✗ nvm ls
->     v12.18.4
       v14.16.0
default -> node (-> v14.16.0)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v14.16.0) (default)
stable -> 14.16 (-> v14.16.0) (default)
lts/* -> lts/fermium (-> v14.16.0)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.0 (-> N/A)
lts/erbium -> v12.21.0 (-> N/A)
lts/fermium -> v14.16.0

How did you install nvm?

Using git

What steps did you perform?

  • git clone
  • cd .nvm
  • git checkout v0.37.2
  • . ./nvm.sh

What happened?

i cannot run npm install already installed from nvm. but working well if using source from nodejs.org download

What did you expect to happen?

working well operation between nvm and manual source

Is there anything in any of your profile files that modifies the PATH?

# Export Command
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"

export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
export PATH="$PATH:/Applications/Sublime Text.app/Contents/SharedSupport/bin"
export PATH="$PATH:/usr/local/bin"
export PATH="$PATH:/usr/local/sbin"
export PATH="$PATH:/usr/local/mysql/bin"
export PATH="$PATH:$HOME/Library/Android/sdk/platform-tools"
# export PATH="$PATH:$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin"
export PATH="$PATH:$HOME/.composer/vendor/bin"
export PATH="$PATH:$HOME/.symfony/bin"

If you are having installation issues, or getting “N/A”, what does curl -I --compressed -v https://nodejs.org/dist/ print out?