macOS Sierra 10.12.5
n --version 2.1.7 (via Homebrew)
brew install n
Fresh installation, no node/npm installed previously
n stablenode -v v8.2.1npm -v 5.3.0npm doctorn 4.1.2node -v v4.1.2npm -v 2.14.4n 8.2.1npm doctornpm list -g --depth=0
/usr/local/lib
└── [email protected]
npm ERR! missing: npm-package-arg@^4.0.0, required by [email protected]
npm ERR! invalid: [email protected] /usr/local/lib/node_modules/npm/node_modules/cmd-shim/node_modules/graceful-fs
npm ERR! invalid: [email protected] /usr/local/lib/node_modules/npm/node_modules/node-gyp/node_modules/glob
npm ERR! invalid: [email protected] /usr/local/lib/node_modules/npm/node_modules/node-gyp/node_modules/tar
npm ERR! invalid: [email protected] /usr/local/lib/node_modules/npm/node_modules/npm-registry-client/node_modules/graceful-fs
npm ERR! invalid: [email protected] /usr/local/lib/node_modules/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream
npm ERR! invalid: [email protected] /usr/local/lib/node_modules/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode
npm ERR! invalid: [email protected] /usr/local/lib/node_modules/npm/node_modules/sha/node_modules/graceful-fs
Working [email protected]
No node/npm installed previously, only through n 8.2.1 and n 4.1.2
Could those invalid packages leftovers from node 4.1.2/npm 2.14.4 ( #403 )? Can't update npm myself.
npm install -g npm@latest
npm ERR! code MODULE_NOT_FOUND
npm ERR! Cannot find module 'internal/fs'
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/name/.npm/_logs/2017-07-30T02_09_56_157Z-debug.log
Probably related to/duplicate of #310.
which n /usr/local/bin/n
Try reinstall npm:
$ curl -0 -L https://npmjs.com/install.sh | sudo sh
You might not need sudo
If doesn't work still, try re-install node.
If you installed node with brew, try:
$ brew uninstall node
$ brew install node
If you still having issues after that, try this solution
I tried the steps @leocaseiro suggested, but that didn't work for me. Oddly re-installing it from the GUI worked (https://nodejs.org/en/download/) -- which installed version Node v8.11.1, NPM 5.6.0. For reference I'm on OSX 10.12.6.
Just wanted to add this comment in case it helps others resolve this issue!
This issue was hopefully fixed by #470
This issue has not had any activity in over six months. It isn't likely to get acted on due to this report.
Feel free to open a new issue if it comes up again, with new information and renewed interest.
Thank you for your contributions.
Most helpful comment
Try reinstall npm:
If doesn't work still, try re-install node.
If you installed node with brew, try:
If you still having issues after that, try this solution