Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

Solution

This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.

Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.

Run the following commands to remove all existing global npm modules, uninstall node & npm, re-install node with the correct defaults, configure the location for global npm modules to be installed, and then install npm as its own pacakge.

rm -rf /usr/local/lib/node_modules
brew uninstall node
brew install node --without-npm
echo prefix=~/.npm-packages >> ~/.npmrc
curl -L https://www.npmjs.com/install.sh | sh

Node and npm should be correctly installed at this point. The final step is to add ~/.npm-packages/bin to your PATH so npm and global npm packages are usable. To do this, add the following line to your ~/.bash_profile:

export PATH="$HOME/.npm-packages/bin:$PATH"

Now you can re-install any global npm packages you need without any problems.

Explanation of the issue

If you're a Homebrew user and you installed node via Homebrew, there is a major philosophical issue with the way Homebrew and NPM work together. If you install node with Homebrew and then try to do npm update npm -g, you may see an error like this:

$ npm update npm -g
npm http GET https://registry.npmjs.org/npm
npm http 304 https://registry.npmjs.org/npm
npm http GET https://registry.npmjs.org/npm/1.4.4
npm http 304 https://registry.npmjs.org/npm/1.4.4
npm ERR! error rolling back Error: Refusing to delete: /usr/local/bin/npm not in /usr/local/lib/node_modules/npm
npm ERR! error rolling back     at clobberFail (/usr/local/Cellar/node/0.10.26/lib/node_modules/npm/lib/utils/gently-rm.js:57:12)
npm ERR! error rolling back     at next (/usr/local/Cellar/node/0.10.26/lib/node_modules/npm/lib/utils/gently-rm.js:43:14)
npm ERR! error rolling back     at /usr/local/Cellar/node/0.10.26/lib/node_modules/npm/lib/utils/gently-rm.js:52:12
npm ERR! error rolling back     at Object.oncomplete (fs.js:107:15)
npm ERR! error rolling back  npm@1.4.4 { [Error: Refusing to delete: /usr/local/bin/npm not in /usr/local/lib/node_modules/npm] code: 'EEXIST', path: '/usr/local/bin/npm' }
npm ERR! Refusing to delete: /usr/local/bin/npm not in /usr/local/lib/node_modules/npm
File exists: /usr/local/bin/npm
Move it away, and try again. 

npm ERR! System Darwin 13.1.0
npm ERR! command "/usr/local/Cellar/node/0.10.26/bin/node" "/usr/local/bin/npm" "update" "npm" "-g"
npm ERR! cwd /Users/dan/Google Drive/Projects/dotfiles
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! path /usr/local/bin/npm
npm ERR! code EEXIST
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/dan/Google Drive/Projects/dotfiles/npm-debug.log
npm ERR! not ok code 0

There's an NPM bug for this exact problem. The bug has been "fixed" by Homebrew installing npm in a way that allows it to manage itself once the install is complete. However, this is error-prone and still seems to cause problems for some people. The root of the the issue is really that npm is its own package manager and it is therefore better to have npm manage itself and its packages completely on its own instead of letting Homebrew do it.

Also, using the Homebrew installation of npm will require you to use sudo when installing global packages. Since one of the core ideas behind Homebrew is that apps can be installed without giving them root access, this is a bad idea.

dbaq commented Apr 17, 2014

Thanks! πŸ‘

Outstanding! πŸ‘

I got these error messages, but it seems to have worked...

Fredriks-MacBook-Pro% curl -L https://www.npmjs.org/install.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 6711 100 6711 0 0 8838 0 --:--:-- --:--:-- --:--:-- 8830
tar=/usr/bin/tar
version:
bsdtar 2.8.3 - libarchive 2.8.3
install npm@latest
fetching: http://registry.npmjs.org/npm/-/npm-2.0.0.tgz

/private/var/folders/qs/8nmw36_11t727ckk5npwv81w0000gn/T/npm.29023/package/bin/read-package-json.js:18
val = val[f]
^
TypeError: Cannot read property 'node' of undefined
at /private/var/folders/qs/8nmw36_11t727ckk5npwv81w0000gn/T/npm.29023/package/bin/read-package-json.js:18:16
at Array.forEach (native)
at /private/var/folders/qs/8nmw36_11t727ckk5npwv81w0000gn/T/npm.29023/package/bin/read-package-json.js:17:11
at Array.forEach (native)
at /private/var/folders/qs/8nmw36_11t727ckk5npwv81w0000gn/T/npm.29023/package/bin/read-package-json.js:14:22
at /private/var/folders/qs/8nmw36_11t727ckk5npwv81w0000gn/T/npm.29023/package/node_modules/read-package-json/read-json.js:51:40
at final (/private/var/folders/qs/8nmw36_11t727ckk5npwv81w0000gn/T/npm.29023/package/node_modules/read-package-json/read-json.js:349:17)
at then (/private/var/folders/qs/8nmw36_11t727ckk5npwv81w0000gn/T/npm.29023/package/node_modules/read-package-json/read-json.js:126:33)
at /private/var/folders/qs/8nmw36_11t727ckk5npwv81w0000gn/T/npm.29023/package/node_modules/read-package-json/read-json.js:266:40
at evalmachine.:271:14
0.10.31

/private/var/folders/qs/8nmw36_11t727ckk5npwv81w0000gn/T/npm.29023/package/bin/read-package-json.js:18
val = val[f]
^
TypeError: Cannot read property 'node' of undefined
at /private/var/folders/qs/8nmw36_11t727ckk5npwv81w0000gn/T/npm.29023/package/bin/read-package-json.js:18:16
at Array.forEach (native)
at /private/var/folders/qs/8nmw36_11t727ckk5npwv81w0000gn/T/npm.29023/package/bin/read-package-json.js:17:11
at Array.forEach (native)
at /private/var/folders/qs/8nmw36_11t727ckk5npwv81w0000gn/T/npm.29023/package/bin/read-package-json.js:14:22
at /private/var/folders/qs/8nmw36_11t727ckk5npwv81w0000gn/T/npm.29023/package/node_modules/read-package-json/read-json.js:51:40
at final (/private/var/folders/qs/8nmw36_11t727ckk5npwv81w0000gn/T/npm.29023/package/node_modules/read-package-json/read-json.js:349:17)
at then (/private/var/folders/qs/8nmw36_11t727ckk5npwv81w0000gn/T/npm.29023/package/node_modules/read-package-json/read-json.js:126:33)
at /private/var/folders/qs/8nmw36_11t727ckk5npwv81w0000gn/T/npm.29023/package/node_modules/read-package-json/read-json.js:266:40
at evalmachine.:271:14

npm@2.0.0 prepublish /private/var/folders/qs/8nmw36_11t727ckk5npwv81w0000gn/T/npm.29023/package
node bin/npm-cli.js prune --prefix=. --no-global && rm -rf test///node_modules && make -j8 doc

make: Nothing to be done for `doc'.
/Users/fredrikbranstrom/.node/bin/npm -> /Users/fredrikbranstrom/.node/lib/node_modules/npm/bin/npm-cli.js
npm@2.0.0 /Users/fredrikbranstrom/.node/lib/node_modules/npm
It worked
Fredriks-MacBook-Pro%

This solution works for me, although it does make me sad that I can’t use Homebrew. I’ve no idea what’s going on underneath the hood, as I’m primarily a Ruby guy. Two strange things jump out at me:

  1. Though ~/.node/bin is on my path, (and not being overridden) I cannot find any of the executables inside using the which -a command… They nonetheless are fully functional.
  2. When I run npm update -g it appears to work as expected, but the following error message shows on completion:
npm ERR! Darwin 13.3.0
npm ERR! argv "node" "/Users/user/.node/bin/npm" "update" "-g"
npm ERR! node v0.10.32
npm ERR! npm  v2.0.0
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package npmconf does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer npm-registry-client@3.2.2 wants npmconf@^2.1.0

I surmised the problem may be npmconf, and perhaps it’s related to this recently opened issue.

Isn't it better to just uninstall node via homebrew and use the installer from nodejs.org? Separating them also seems a bit odd

Thanks this helped me fix my npm issues

Huge help. Thanks.

Wow, been looking for this solution for a full day. Thanks for posting, great stuff.

SO much this! Extremely helpful.

Thank you!

Please add this step, before deleting /usr/local/node_modules (to not lose all your work):
ls -1 /usr/local/node_modules > ~/node_modules.txt
at the end, do:
for i in cat ~/node_modules.txt;do npm install -g $i;done

Hopefully, it is not necessary to track module versions or the new private npm modules.

espiler commented Nov 3, 2014

Thanks a ton!

cmezian commented Nov 10, 2014

Worked like a charm for my older iMac, thank you!

Until I typed in "npm install -g blah, blah, blah", everything worked. Once I tried to re-install some global node modules, I get: "bash: /usr/local/bin/npm: No such file or directory". Anyone else run into this? Any thoughts? Seems like it can be fixed by something simple. Thanks!

gavstah commented Nov 25, 2014

This worked a treat for me. Up until now, I'd been struggling to get node & npm going on my mac.

@GrimmOutlook - judging by the output, it seems like npm's looking in the wrong place - did you add ~/.npm/bin to your path and then run:

source ~/.bash_profile

to load the path change?

Hmm. Now none of my newly installed global commands are found. In fact a node_modules folder isn't created in my home directory. All modules are being installed into /usr/local/bin/ which is already in my path.

Thanks for this, it all worked great up to the point when I re-open terminal, just like @GrimmOutlook described.
So after restarting terminal it says -bash: npm: command not found
So I have to export PATH="$HOME/.node/bin:$PATH" each time I open it up.
Any idea how to fix that?

thanks your are the πŸ‘¨

Incredibly helpful. Thanks so much.

aljopro commented Dec 28, 2014

@unostella, I had to put the export ~/.profile instead of ~/.path

Thank you!

kaishin commented Dec 31, 2014

This worked great, thanks!

thank you!

node 0.10.26 is still installed.
Remove them all with brew uninstall --force node.

Also, "npm cache clear" is good for testing the cmd as well.

Thanks for the gist!

phudekar commented Jan 6, 2015

Thanks. You saved my day

Serious thanks for this!

favorit commented Jan 20, 2015

Thank you! It works for me!

awesome, i'm back in business, thanks!

D-Juice commented Jan 24, 2015

Thankyou so much!

More thanks from me, too ;)

THANKS!!

Thank you so very much!

fa3 commented Feb 3, 2015

What can i say instead Thank you? Ha, thank you very much!

hi, printed error: /usr/local/bin/npm: No such file or directory , help me.

Thank you so much!

guimap commented Feb 11, 2015

Thanksss man, u save my life, thanks thanks....

Dang, I tried these instructions and everything worked well until running the script:

$ curl -L https://www.npmjs.org/install.sh | sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 51 100 51 0 0 124 0 --:--:-- --:--:-- --:--:-- 124 100 6239 100 6239 0 0 8293 0 --:--:-- --:--:-- --:--:-- 23022 sh: line 21: npm-install-36841.sh: Permission denied rm: npm-install-36841.sh: No such file or directory Failed to download script

mnlsn commented Feb 15, 2015

use curl -L https://www.npmjs.com/install.sh | sh if you get the Permission Denied error when installing npm

rowild commented Feb 19, 2015

I got an error on Mac Maverick 10.9.5, because I use MAMP, which elivers its own libtool. I could solve this problem by creating a symlink from the MAMP version to the bin version

// create backup of MAMP libtool
mv /Applications/MAMP/bin/libtool /Applications/MAMP/bin/libtool_orig

// create symlink
ln -s /usr/bin/libtool /Applications/MAMP/bin/libtool

// then install node

Just in case somebody got the same error...

Thanks for your solution!!!

Worked like a charm!

OMG THANK YOU!!!!!!

jserrao commented Feb 23, 2015

FYI: 'curl -L https://www.npmjs.org/install.sh | sh' returns a 404 for me. Just drop the https to http and things worked swimmingly. Thanks for digging into this issue. I've long had conflicts similar to those noted in your post and this resolved a great many of them.

irealva commented Feb 24, 2015

Awesome, this helped a lot. I first ran:

$ brew doctor

and fixed all the node related warning. Then followed your instructions and it worked like a charm.

This page helped too: http://forums.webhook.com/t/cant-get-node-to-install-on-latest-osx-mavericks-resolved/109/5

If I use brew install node --without-npm command to isntall node, what's gonna happen when node gets updated via homebrew? Will that install npm?

Thanks so much.

Thanks! You're the man! πŸ‘‘

πŸ‘ thank you!

Excelent ! (Y)

guoylyy commented Mar 27, 2015

Excelent! Thanks a lot.

Thanks πŸ‘

Thanks! Nothing's ever easy...

mitogh commented Apr 5, 2015

Thanks, works perfect. πŸ‘

arnelh commented Apr 15, 2015

Thanks

Thank you!

Thanks so much!

Awesome to see this! But it's weird. I followed the instructions and added .npm and .node\bin to my zshrc, but I am still getting the access errors. Sumfin not quite right

Awesome, thanks!

zekitow commented Apr 24, 2015

Thanks!!!

Cheeers!

buk commented Apr 27, 2015

Thanks!

ThanksO(∩_∩)O!

Thanks!!

SGD1953 commented May 5, 2015

Thanks a lot, I got errors when installing npm, doing an additional sudo rm -rf ~/.npm did the trick for me.

I get a strange warning/error but then it proceeds to say "It worked"

curl -L https://www.npmjs.com/install.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 6239 100 6239 0 0 6043 0 0:00:01 0:00:01 --:--:-- 6045
tar=/usr/bin/tar
version:
bsdtar 2.8.3 - libarchive 2.8.3
install npm@latest
fetching: http://registry.npmjs.org/npm/-/npm-2.9.1.tgz

npm@2.9.1 prepublish /private/var/folders/1m/f2btkb_j5ng6bzhmzmm73hc40000gn/T/npm.32190/package
node bin/npm-cli.js prune --prefix=. --no-global && rimraf test///node_modules && make -j4 doc

sh: rimraf: command not found

Many thanks. Installing npm with Homebrew never seemed to work properly but I never knew why. Now I still don't but have them installed :)

I had to use SGD1953's tip and do "sudo rm -rf ~/.npm" before installing npm. Otherwise this happened.

npm ERR! Darwin 13.4.0
npm ERR! argv "/usr/local/bin/node" "/private/var/folders/_b/g8fdbnmx317_s0dlnp784pbr0000gn/T/npm.33170/package/cli.js" "install" "-gf"
npm ERR! node v0.12.2
npm ERR! npm v2.9.1

npm ERR! Attempt to unlock /Users/[MYUSER]/.node/lib/node_modules/npm, which hasn't been locked

@unostella did you ever figure out a fix? I am still getting the same error.

Thank you very much! Works a treat!

Thank you. Works! Had to add the sudo rm -rf ~/.npm (tip from SGD1953)

wow! thanks! resolved a totally different error message for me, but awesome! kudos!

This was very useful when I had to re-install npm .

Ledge!

0is1 commented May 18, 2015

Yes, thanks! This was really helpful :)

Worked great except for one issue, after running brew install node --without-npm i kept getting
"Could not symlink lib/dtrace/node.d
/usr/local/lib/dtrace is not writable"

I had to run 'sudo chown -R whoami /usr/local' to be able to link brew to node.

This is funny, I came about the same solution through trial and error and stack overflow.

@ghost

ghost commented May 28, 2015

Thank you!!!

ser111 commented May 30, 2015

You're the man.

jonrh commented Jun 7, 2015

Awesome, thank you! Following the instructions I ran into some Homebrew issues. Running brew update and then following the instructions again worked.

sagic commented Jun 8, 2015

thanks :)

adaam2 commented Jun 12, 2015

This is awesome! great work

jromeem commented Jun 14, 2015

this is great!! thanks a butt ton! πŸ‘

bghill commented Jun 15, 2015

At some point I must have installed node.js directly. Later I installed via brew. I suspect this is what led my version of node get screwed up file permissions. Out of curiosity, I wanted to see if a "clean" install of node from homebrew would still have the permissions issue. I followed this script: https://gist.github.com/nicerobot/2697848 for most of the uninstall. I also had to remove the ~/.npm and /usr/local/share/systemtap. I only removed the latter after verifying that there was nothing in it related to anything else on my system. With that done, I was able to execute brew install node and the permission issues seem to have disappeared. npm update npm -g now works fine, as does the build process that was giving me trouble.

Let me know if this works for anyone else. I'm curious if most folks just have a long forgotten collision between installs, and complete cleanup is the current solution.

This is awesome. Thank you.

Excellent. Thank you!


git clone git://github.com/ry/node.git
(cd node && ./configure && make && sudo make install)
chown -R "$USER" /usr/local/{share/man,bin,lib/node,include/node};
npm update npm -g
node -v && npm -v

Thanks!

gbanis commented Jul 1, 2015

Worked like a charm. Later I had to remove nvm as well and now everything is in tune. Thank you!

aking13 commented Jul 2, 2015

You have literally brought so much satisfaction to 3 hours of troubleshooting with so many nodejs, npm, brew problems. Thank you! Thank you!

The installation process works for me (i.e. it doesn't break) but after installing packages globally, I find that node apparently won't look at the default global path for npm packages. Installing packages locally works just fine.

Thanks, It worked 😊

Working like a glove!

@ghost

ghost commented Jul 13, 2015

Fantastic solution - it sorted my problem with installing react native :) Many thanks

Thank you very much, it worked! ;)

Didn't work for me

Got the following error:

-bash: npm: command not found

My .bash_profile:

[[ -s ~/.bashrc ]] && source ~/.bashrc

My .bashrc:

source dnvm.sh
export MONO_MANAGED_WATCHER=disabled

My .path:

export PATH=/Users/GabrielRibeiro/.node/bin:/Users/GabrielRibeiro/.dnx/runtimes/dnx-mono.1.0.0-b$
export PATH="$HOME/.node/bin:$PATH"

What I did wrong?

qqilihq commented Jul 24, 2015

Worked like a charm. Thank you!

philals commented Jul 26, 2015

Thanks!

ljhan commented Aug 2, 2015

Thank you so much for the help! I still have to export PATH="$HOME/.node/bin:$PATH" each time terminal is re-opened... Could there be a problem with the NODE_PATH?

agostlg commented Aug 2, 2015

Thanks!

I was able to install node without npm through brew but I get this error when running the curl command:

nick$ curl -L https://www.npmjs.com/install.sh | sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  6239  100  6239    0     0   8375      0 --:--:-- --:--:-- --:--:--  8374
tar=/usr/bin/tar
version:
bsdtar 2.8.3 - libarchive 2.8.3
install npm@latest
fetching: http://registry.npmjs.org/npm/-/npm-2.13.3.tgz
npm ERR! Darwin 14.3.0
npm ERR! argv "/usr/local/bin/node" "/private/var/folders/hq/2mf0j5sj0c160gl3x33btbmr0000gn/T/npm.4470/package/cli.js" "rm" "npm" "-gf"
npm ERR! node v0.12.7
npm ERR! npm  v2.13.3
npm ERR! path /Users/nick/.node/lib/node_modules/npm/node_modules
npm ERR! code EACCES
npm ERR! errno -13

npm ERR! Error: EACCES, rmdir '/Users/nick/.node/lib/node_modules/npm/node_modules'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES, rmdir '/Users/nick/.node/lib/node_modules/npm/node_modules']
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/Users/nick/.node/lib/node_modules/npm/node_modules' }
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!     /private/var/folders/hq/2mf0j5sj0c160gl3x33btbmr0000gn/T/npm.4470/package/npm-debug.log

> npm@2.13.3 prepublish /private/var/folders/hq/2mf0j5sj0c160gl3x33btbmr0000gn/T/npm.4470/package
> node bin/npm-cli.js prune --prefix=. --no-global && rimraf test/*/*/node_modules && make -j4 doc

sh: rimraf: command not found
npm ERR! Darwin 14.3.0
npm ERR! argv "/usr/local/bin/node" "/private/var/folders/hq/2mf0j5sj0c160gl3x33btbmr0000gn/T/npm.4470/package/cli.js" "install" "-gf"
npm ERR! node v0.12.7
npm ERR! npm  v2.13.3
npm ERR! path /Users/nick/.node/lib/node_modules/npm/node_modules
npm ERR! code EACCES
npm ERR! errno -13

npm ERR! Error: EACCES, rmdir '/Users/nick/.node/lib/node_modules/npm/node_modules'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES, rmdir '/Users/nick/.node/lib/node_modules/npm/node_modules']
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/Users/nick/.node/lib/node_modules/npm/node_modules' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EACCES, rmdir '/Users/nick/.node/lib/node_modules/npm/node_modules'
npm ERR! error rolling back     at Error (native)
npm ERR! error rolling back  { [Error: EACCES, rmdir '/Users/nick/.node/lib/node_modules/npm/node_modules']
npm ERR! error rolling back   errno: -13,
npm ERR! error rolling back   code: 'EACCES',
npm ERR! error rolling back   path: '/Users/nick/.node/lib/node_modules/npm/node_modules' }

npm ERR! Please include the following file with any support request:
npm ERR!     /private/var/folders/hq/2mf0j5sj0c160gl3x33btbmr0000gn/T/npm.4470/package/npm-debug.log
It failed

Any ideas?

@WeHateNick try $ curl -L https://www.npmjs.com/install.sh | sudo sh

@ljhan I had the same as you have.
I solved the problem by doing this :
$ touch .bash_profile
$ open .bash_profile
In .bash_profil i added this line
source ~/.bashrc

http://hathaway.cc/post/69201163472/how-to-edit-your-path-environment-variables-on-mac

THANKYOU @aliwatters this has been bugging me for days!

Cannot install, get error: "npm-install-34536.sh: Permission denied" when attempting "curl -L https://www.npmjs.com/install.sh | sh"

In accordance with what @walterspieler said above if you continue to see this error after you add the source ~/.bashrc it could be because you already have a .node directory in your home directory. I renamed my current .node directory (you could just delete it) then ran it again and it worked. Also you may already have a .profile in which case you can add the source ~/.bashrc to it instead.

@ljhan you have to add export PATH="$HOME/.node/bin:$PATH" to your ~/.bash_profile or ~/.path file

Thanks a lot!

@alexortiz201 - I use zsh and ohmyzsh. how to make it work for me

In a nutshell:

ls -1 /usr/local/lib/node_modules > ~/node_modules.txt
sed -e "s,/\+$,," -e "s,^/\+,," ~/node_modules.txt
rm -rf /usr/local/lib/node_modules
brew uninstall node --force node
brew install node --without-npm
echo prefix=~/.node >> ~/.npmrc
curl -L https://www.npmjs.com/install.sh | sh
echo 'export PATH="$HOME/.node/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
for i in `cat ~/node_modules.txt`;do npm install -g $i;done
rm ~/node_modules.txt

πŸ‘ all good here, thanks!

ilysm, thanks!

huijing commented Sep 25, 2015

Following the steps but when I run curl -L https://www.npmjs.com/install.sh | sh I get the following errors:

scripts/installable.sh: line 4: semver: command not found
Packaging or installing npm@3.3.4 with npm@3.3.4 is impossible.
Please install npm@^3.0.0-0 from the registry and use that or run your command with
this version of npm with:
    /usr/local/Cellar/node/4.1.1/bin/node /var/folders/0g/9lxn9c8d3czfj0qvs_qjflxxrn5xph/T/npm.18926/package install -gf
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/Cellar/node/4.1.1/bin/node" "/private/var/folders/0g/9lxn9c8d3czfj0qvs_qjflxxrn5xph/T/npm.18926/package/cli.js" "install" "-gf"
npm ERR! node v4.1.1
npm ERR! npm  v3.3.4

npm ERR! Maximum call stack size exceeded
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /private/var/folders/0g/9lxn9c8d3czfj0qvs_qjflxxrn5xph/T/npm.18926/package/npm-debug.log
It failed

Does this have to do with the latest update to node?

Im getting the same error as @huljing. @huljing did you resolve your issue?

beastmike commented Sep 29, 2015

@jitendravyas - open ~/.zshrc, copy & paste export PATH="$HOME/.npm-packages/bin:$PATH" then save.

rcastag commented Oct 2, 2015

Amazeballs!

I have the same issue as @huijing and @nabeel-ibrahim. Did you find some solution? I thought it was an error of node v4 but I downgraded to v0.12.7 but the issue still persists.
Update
I have noticed that actually there is a version of npm installed. I followed this tutorial and I continued with the next steps after npm install and it works for me.

Great! It Works fine for me!

skad21 commented Oct 11, 2015

Very helpfull tips...great, thanks !

@huijing first export PATH="$HOME/.node/bin:$PATH" and then cd into your project directory or any directory where package.json file exist. semver is a version tester so you can install it once you have package.json file.

πŸ‘

i am unable to update my global npm modules with npm update -g how do i fix this?

shaunstanislaus@Master ~ $ npm update -g
npm ERR! Darwin 14.5.0
npm ERR! argv "/Users/shaunstanislaus/homebrew/Cellar/node/4.2.1/bin/node" "/usr/local/bin/npm" "update" "-g"
npm ERR! node v4.2.1
npm ERR! npm  v3.3.8
npm ERR! code E404

npm ERR! 404 Registry returned 404 for GET on http://registry.npmjs.org/npm-debug.log
npm ERR! 404
npm ERR! 404 'npm-debug.log' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/shaunstanislaus/npm-debug.log
shaunstanislaus@Master ~ $

npm-debug.log

0 info it worked if it ends with ok
1 verbose cli [ '/Users/shaunstanislaus/homebrew/Cellar/node/4.2.1/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'update',
1 verbose cli   '-g' ]
2 info using npm@3.3.8
3 info using node@v4.2.1
4 silly mapToRegistry name npm-debug.log
5 silly mapToRegistry using default registry
6 silly mapToRegistry registry http://registry.npmjs.org/
7 silly mapToRegistry uri http://registry.npmjs.org/npm-debug.log
8 silly mapToRegistry name babel
9 silly mapToRegistry using default registry
10 silly mapToRegistry registry http://registry.npmjs.org/
11 silly mapToRegistry uri http://registry.npmjs.org/babel
12 silly mapToRegistry name babel-node-debug
13 silly mapToRegistry using default registry
14 silly mapToRegistry registry http://registry.npmjs.org/
15 silly mapToRegistry uri http://registry.npmjs.org/babel-node-debug
16 silly mapToRegistry name bower
17 silly mapToRegistry using default registry
18 silly mapToRegistry registry http://registry.npmjs.org/
19 silly mapToRegistry uri http://registry.npmjs.org/bower
20 silly mapToRegistry name brunch
21 silly mapToRegistry using default registry
22 silly mapToRegistry registry http://registry.npmjs.org/
23 silly mapToRegistry uri http://registry.npmjs.org/brunch
24 silly mapToRegistry name cordova
25 silly mapToRegistry using default registry
26 silly mapToRegistry registry http://registry.npmjs.org/
27 silly mapToRegistry uri http://registry.npmjs.org/cordova
28 silly mapToRegistry name cssfmt
29 silly mapToRegistry using default registry
30 silly mapToRegistry registry http://registry.npmjs.org/
31 silly mapToRegistry uri http://registry.npmjs.org/cssfmt
32 silly mapToRegistry name express
33 silly mapToRegistry using default registry
34 silly mapToRegistry registry http://registry.npmjs.org/
35 silly mapToRegistry uri http://registry.npmjs.org/express
36 silly mapToRegistry name express-generator
37 silly mapToRegistry using default registry
38 silly mapToRegistry registry http://registry.npmjs.org/
39 silly mapToRegistry uri http://registry.npmjs.org/express-generator
40 silly mapToRegistry name generator-loopback
41 silly mapToRegistry using default registry
42 silly mapToRegistry registry http://registry.npmjs.org/
43 silly mapToRegistry uri http://registry.npmjs.org/generator-loopback
44 silly mapToRegistry name grunt
45 silly mapToRegistry using default registry
46 silly mapToRegistry registry http://registry.npmjs.org/
47 silly mapToRegistry uri http://registry.npmjs.org/grunt
48 silly mapToRegistry name ionic
49 silly mapToRegistry using default registry
50 silly mapToRegistry registry http://registry.npmjs.org/
51 silly mapToRegistry uri http://registry.npmjs.org/ionic
52 silly mapToRegistry name jscs
53 silly mapToRegistry using default registry
54 silly mapToRegistry registry http://registry.npmjs.org/
55 silly mapToRegistry uri http://registry.npmjs.org/jscs
56 silly mapToRegistry name jshint
57 silly mapToRegistry using default registry
58 silly mapToRegistry registry http://registry.npmjs.org/
59 silly mapToRegistry uri http://registry.npmjs.org/jshint
60 silly mapToRegistry name JSONStream
61 silly mapToRegistry using default registry
62 silly mapToRegistry registry http://registry.npmjs.org/
63 silly mapToRegistry uri http://registry.npmjs.org/JSONStream
64 silly mapToRegistry name less
65 silly mapToRegistry using default registry
66 silly mapToRegistry registry http://registry.npmjs.org/
67 silly mapToRegistry uri http://registry.npmjs.org/less
68 silly mapToRegistry name mongoose
69 silly mapToRegistry using default registry
70 silly mapToRegistry registry http://registry.npmjs.org/
71 silly mapToRegistry uri http://registry.npmjs.org/mongoose
72 silly mapToRegistry name node-gyp
73 silly mapToRegistry using default registry
74 silly mapToRegistry registry http://registry.npmjs.org/
75 silly mapToRegistry uri http://registry.npmjs.org/node-gyp
76 silly mapToRegistry name node-pre-gyp
77 silly mapToRegistry using default registry
78 silly mapToRegistry registry http://registry.npmjs.org/
79 silly mapToRegistry uri http://registry.npmjs.org/node-pre-gyp
80 silly mapToRegistry name nodemon
81 silly mapToRegistry using default registry
82 silly mapToRegistry registry http://registry.npmjs.org/
83 silly mapToRegistry uri http://registry.npmjs.org/nodemon
84 silly mapToRegistry name npm
85 silly mapToRegistry using default registry
86 silly mapToRegistry registry http://registry.npmjs.org/
87 silly mapToRegistry uri http://registry.npmjs.org/npm
88 silly mapToRegistry name sails
89 silly mapToRegistry using default registry
90 silly mapToRegistry registry http://registry.npmjs.org/
91 silly mapToRegistry uri http://registry.npmjs.org/sails
92 silly mapToRegistry name sshync
93 silly mapToRegistry using default registry
94 silly mapToRegistry registry http://registry.npmjs.org/
95 silly mapToRegistry uri http://registry.npmjs.org/sshync
96 silly mapToRegistry name strongloop
97 silly mapToRegistry using default registry
98 silly mapToRegistry registry http://registry.npmjs.org/
99 silly mapToRegistry uri http://registry.npmjs.org/strongloop
100 silly mapToRegistry name treeline
101 silly mapToRegistry using default registry
102 silly mapToRegistry registry http://registry.npmjs.org/
103 silly mapToRegistry uri http://registry.npmjs.org/treeline
104 silly mapToRegistry name vantage
105 silly mapToRegistry using default registry
106 silly mapToRegistry registry http://registry.npmjs.org/
107 silly mapToRegistry uri http://registry.npmjs.org/vantage
108 silly mapToRegistry name webpack
109 silly mapToRegistry using default registry
110 silly mapToRegistry registry http://registry.npmjs.org/
111 silly mapToRegistry uri http://registry.npmjs.org/webpack
112 silly mapToRegistry name yeoman-doctor
113 silly mapToRegistry using default registry
114 silly mapToRegistry registry http://registry.npmjs.org/
115 silly mapToRegistry uri http://registry.npmjs.org/yeoman-doctor
116 silly mapToRegistry name yeoman-doctor
117 silly mapToRegistry using default registry
118 silly mapToRegistry registry http://registry.npmjs.org/
119 silly mapToRegistry uri http://registry.npmjs.org/yeoman-doctor
120 silly mapToRegistry name yo
121 silly mapToRegistry using default registry
122 silly mapToRegistry registry http://registry.npmjs.org/
123 silly mapToRegistry uri http://registry.npmjs.org/yo
124 silly mapToRegistry name zmail
125 silly mapToRegistry using default registry
126 silly mapToRegistry registry http://registry.npmjs.org/
127 silly mapToRegistry uri http://registry.npmjs.org/zmail
128 silly mapToRegistry name grunt-cli
129 silly mapToRegistry using default registry
130 silly mapToRegistry registry http://registry.npmjs.org/
131 silly mapToRegistry uri http://registry.npmjs.org/grunt-cli
132 verbose request uri http://registry.npmjs.org/npm-debug.log
133 verbose request no auth needed
134 info attempt registry request try #1 at 1:06:52 AM
135 verbose request id 2d21400bf4abeaf1
136 http request GET http://registry.npmjs.org/npm-debug.log
137 verbose request uri http://registry.npmjs.org/babel-node-debug
138 verbose request no auth needed
139 info attempt registry request try #1 at 1:06:53 AM
140 verbose etag "DYB5NS29XNXLYS8MF7DRGGOI4"
141 http request GET http://registry.npmjs.org/babel-node-debug
142 verbose request uri http://registry.npmjs.org/bower
143 verbose request no auth needed
144 info attempt registry request try #1 at 1:06:53 AM
145 verbose etag "1UEAMQBQL100C69LQBPTRT1TD"
146 http request GET http://registry.npmjs.org/bower
147 verbose request uri http://registry.npmjs.org/babel
148 verbose request no auth needed
149 info attempt registry request try #1 at 1:06:53 AM
150 verbose etag "72G2692CXLT4AJ39ICR07LUAV"
151 http request GET http://registry.npmjs.org/babel
152 verbose request uri http://registry.npmjs.org/cssfmt
153 verbose request no auth needed
154 info attempt registry request try #1 at 1:06:53 AM
155 verbose etag "6B0NHO1YCR2VFACUUDP28BXER"
156 http request GET http://registry.npmjs.org/cssfmt
157 verbose request uri http://registry.npmjs.org/brunch
158 verbose request no auth needed
159 info attempt registry request try #1 at 1:06:53 AM
160 verbose etag "A0TSRVQEK2NQ14MM1DTLAM0ND"
161 http request GET http://registry.npmjs.org/brunch
162 verbose request uri http://registry.npmjs.org/express-generator
163 verbose request no auth needed
164 info attempt registry request try #1 at 1:06:53 AM
165 verbose etag "DC6D0QBZ1P150ODW8Y6TKATYF"
166 http request GET http://registry.npmjs.org/express-generator
167 verbose request uri http://registry.npmjs.org/cordova
168 verbose request no auth needed
169 info attempt registry request try #1 at 1:06:53 AM
170 verbose etag "48KO6YHTOCVRXRURH5YYDN9WQ"
171 http request GET http://registry.npmjs.org/cordova
172 verbose request uri http://registry.npmjs.org/generator-loopback
173 verbose request no auth needed
174 info attempt registry request try #1 at 1:06:53 AM
175 verbose etag "AJ8DMB3AW5NQ7NQFHG8F5N7D4"
176 http request GET http://registry.npmjs.org/generator-loopback
177 verbose request uri http://registry.npmjs.org/express
178 verbose request no auth needed
179 info attempt registry request try #1 at 1:06:53 AM
180 verbose etag "OPZ5B9E5KKQFOJRL0T2D4NAJ"
181 http request GET http://registry.npmjs.org/express
182 verbose request uri http://registry.npmjs.org/grunt
183 verbose request no auth needed
184 info attempt registry request try #1 at 1:06:53 AM
185 verbose etag "3GH7OOJ1KU9YLMMZ1A0UO05B1"
186 http request GET http://registry.npmjs.org/grunt
187 verbose request uri http://registry.npmjs.org/jscs
188 verbose request no auth needed
189 info attempt registry request try #1 at 1:06:53 AM
190 verbose etag "1CH7UC3D1A40HWT8VLEX00D35"
191 http request GET http://registry.npmjs.org/jscs
192 verbose request uri http://registry.npmjs.org/jshint
193 verbose request no auth needed
194 info attempt registry request try #1 at 1:06:53 AM
195 verbose etag "APE2YPS3KEWRLJGKNPDJSLHFJ"
196 http request GET http://registry.npmjs.org/jshint
197 verbose request uri http://registry.npmjs.org/ionic
198 verbose request no auth needed
199 info attempt registry request try #1 at 1:06:53 AM
200 verbose etag "7F6QII55NWTSUNMKTM0IFAXM3"
201 http request GET http://registry.npmjs.org/ionic
202 verbose request uri http://registry.npmjs.org/JSONStream
203 verbose request no auth needed
204 info attempt registry request try #1 at 1:06:53 AM
205 verbose etag "CBJ0I3CJTQUU23PHUV2OWT75B"
206 http request GET http://registry.npmjs.org/JSONStream
207 verbose request uri http://registry.npmjs.org/less
208 verbose request no auth needed
209 info attempt registry request try #1 at 1:06:53 AM
210 verbose etag "BXE4R1F57H1LHECUL3J7HKRQ7"
211 http request GET http://registry.npmjs.org/less
212 verbose request uri http://registry.npmjs.org/node-gyp
213 verbose request no auth needed
214 info attempt registry request try #1 at 1:06:53 AM
215 verbose etag "EKRR1HRWG4UNBI6CFGJ0H257K"
216 http request GET http://registry.npmjs.org/node-gyp
217 verbose request uri http://registry.npmjs.org/mongoose
218 verbose request no auth needed
219 info attempt registry request try #1 at 1:06:53 AM
220 verbose etag "ELBMLIYCCQTWX9N6LG10KURW3"
221 http request GET http://registry.npmjs.org/mongoose
222 verbose request uri http://registry.npmjs.org/node-pre-gyp
223 verbose request no auth needed
224 info attempt registry request try #1 at 1:06:53 AM
225 verbose etag "51PJ29TLKG5BZ0EPTUIVMCXQD"
226 http request GET http://registry.npmjs.org/node-pre-gyp
227 verbose request uri http://registry.npmjs.org/nodemon
228 verbose request no auth needed
229 info attempt registry request try #1 at 1:06:53 AM
230 verbose etag "BQOK5XKL2XVJ1G33CPOUEQR2U"
231 http request GET http://registry.npmjs.org/nodemon
232 verbose request uri http://registry.npmjs.org/sails
233 verbose request no auth needed
234 info attempt registry request try #1 at 1:06:53 AM
235 verbose etag "7B15DVBD7LHH07827X3MVFUT1"
236 http request GET http://registry.npmjs.org/sails
237 verbose request uri http://registry.npmjs.org/sshync
238 verbose request no auth needed
239 info attempt registry request try #1 at 1:06:53 AM
240 verbose etag "DK45HJHVWUKG1YP67IJEJWSK6"
241 http request GET http://registry.npmjs.org/sshync
242 verbose request uri http://registry.npmjs.org/strongloop
243 verbose request no auth needed
244 info attempt registry request try #1 at 1:06:53 AM
245 verbose etag "9ZIYP66GBN3INMZ5INBEO1PVA"
246 http request GET http://registry.npmjs.org/strongloop
247 verbose request uri http://registry.npmjs.org/npm
248 verbose request no auth needed
249 info attempt registry request try #1 at 1:06:53 AM
250 verbose etag "YMG7LMJXURZSL37T7C8446E9"
251 http request GET http://registry.npmjs.org/npm
252 verbose request uri http://registry.npmjs.org/vantage
253 verbose request no auth needed
254 info attempt registry request try #1 at 1:06:53 AM
255 verbose etag "1Q63LE1AFM5XBL6TRY675R85J"
256 http request GET http://registry.npmjs.org/vantage
257 verbose request uri http://registry.npmjs.org/treeline
258 verbose request no auth needed
259 info attempt registry request try #1 at 1:06:53 AM
260 verbose etag "CWORTQXFLSP25P3AGFYQS60MZ"
261 http request GET http://registry.npmjs.org/treeline
262 verbose request uri http://registry.npmjs.org/yeoman-doctor
263 verbose request no auth needed
264 info attempt registry request try #1 at 1:06:53 AM
265 verbose etag "6NYMSIDXJCTY8S59O4AI0XD7H"
266 http request GET http://registry.npmjs.org/yeoman-doctor
267 verbose request uri http://registry.npmjs.org/yeoman-doctor
268 verbose request no auth needed
269 info attempt registry request try #1 at 1:06:53 AM
270 verbose etag "6NYMSIDXJCTY8S59O4AI0XD7H"
271 http request GET http://registry.npmjs.org/yeoman-doctor
272 verbose request uri http://registry.npmjs.org/yo
273 verbose request no auth needed
274 info attempt registry request try #1 at 1:06:53 AM
275 verbose etag "7E14URUC82U459C21UDRSP2T0"
276 http request GET http://registry.npmjs.org/yo
277 verbose request uri http://registry.npmjs.org/zmail
278 verbose request no auth needed
279 info attempt registry request try #1 at 1:06:53 AM
280 verbose etag "3MM9M8AWFVQW1KMWIWUG0CLD2"
281 http request GET http://registry.npmjs.org/zmail
282 verbose request uri http://registry.npmjs.org/grunt-cli
283 verbose request no auth needed
284 info attempt registry request try #1 at 1:06:53 AM
285 verbose etag "3GZDLQ4H10MQM4GE4EHHDBNBJ"
286 http request GET http://registry.npmjs.org/grunt-cli
287 verbose request uri http://registry.npmjs.org/webpack
288 verbose request no auth needed
289 info attempt registry request try #1 at 1:06:53 AM
290 verbose etag "8EDJM2GQ6JXB5T7RAR3SZOVES"
291 http request GET http://registry.npmjs.org/webpack
292 http 304 http://registry.npmjs.org/bower
293 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
293 verbose headers   via: '1.1 varnish',
293 verbose headers   'cache-control': 'max-age=60',
293 verbose headers   etag: '"1UEAMQBQL100C69LQBPTRT1TD"',
293 verbose headers   age: '35',
293 verbose headers   connection: 'keep-alive',
293 verbose headers   'x-served-by': 'cache-sin6924-SIN',
293 verbose headers   'x-cache': 'HIT',
293 verbose headers   'x-cache-hits': '50',
293 verbose headers   'x-timer': 'S1444842413.248808,VS0,VE0',
293 verbose headers   vary: 'Accept' }
294 silly get cb [ 304,
294 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
294 silly get     via: '1.1 varnish',
294 silly get     'cache-control': 'max-age=60',
294 silly get     etag: '"1UEAMQBQL100C69LQBPTRT1TD"',
294 silly get     age: '35',
294 silly get     connection: 'keep-alive',
294 silly get     'x-served-by': 'cache-sin6924-SIN',
294 silly get     'x-cache': 'HIT',
294 silly get     'x-cache-hits': '50',
294 silly get     'x-timer': 'S1444842413.248808,VS0,VE0',
294 silly get     vary: 'Accept' } ]
295 verbose etag http://registry.npmjs.org/bower from cache
296 verbose get saving bower to /Users/shaunstanislaus/.npm/registry.npmjs.org/bower/.cache.json
297 http 304 http://registry.npmjs.org/cordova
298 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
298 verbose headers   via: '1.1 varnish',
298 verbose headers   'cache-control': 'max-age=60',
298 verbose headers   etag: '"48KO6YHTOCVRXRURH5YYDN9WQ"',
298 verbose headers   age: '51',
298 verbose headers   connection: 'keep-alive',
298 verbose headers   'x-served-by': 'cache-sin6923-SIN',
298 verbose headers   'x-cache': 'HIT',
298 verbose headers   'x-cache-hits': '3',
298 verbose headers   'x-timer': 'S1444842413.246823,VS0,VE0',
298 verbose headers   vary: 'Accept' }
299 silly get cb [ 304,
299 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
299 silly get     via: '1.1 varnish',
299 silly get     'cache-control': 'max-age=60',
299 silly get     etag: '"48KO6YHTOCVRXRURH5YYDN9WQ"',
299 silly get     age: '51',
299 silly get     connection: 'keep-alive',
299 silly get     'x-served-by': 'cache-sin6923-SIN',
299 silly get     'x-cache': 'HIT',
299 silly get     'x-cache-hits': '3',
299 silly get     'x-timer': 'S1444842413.246823,VS0,VE0',
299 silly get     vary: 'Accept' } ]
300 verbose etag http://registry.npmjs.org/cordova from cache
301 verbose get saving cordova to /Users/shaunstanislaus/.npm/registry.npmjs.org/cordova/.cache.json
302 http 304 http://registry.npmjs.org/grunt
303 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
303 verbose headers   via: '1.1 varnish',
303 verbose headers   'cache-control': 'max-age=60',
303 verbose headers   etag: '"3GH7OOJ1KU9YLMMZ1A0UO05B1"',
303 verbose headers   age: '40',
303 verbose headers   connection: 'keep-alive',
303 verbose headers   'x-served-by': 'cache-sin6922-SIN',
303 verbose headers   'x-cache': 'HIT',
303 verbose headers   'x-cache-hits': '2',
303 verbose headers   'x-timer': 'S1444842413.249913,VS0,VE0',
303 verbose headers   vary: 'Accept' }
304 silly get cb [ 304,
304 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
304 silly get     via: '1.1 varnish',
304 silly get     'cache-control': 'max-age=60',
304 silly get     etag: '"3GH7OOJ1KU9YLMMZ1A0UO05B1"',
304 silly get     age: '40',
304 silly get     connection: 'keep-alive',
304 silly get     'x-served-by': 'cache-sin6922-SIN',
304 silly get     'x-cache': 'HIT',
304 silly get     'x-cache-hits': '2',
304 silly get     'x-timer': 'S1444842413.249913,VS0,VE0',
304 silly get     vary: 'Accept' } ]
305 verbose etag http://registry.npmjs.org/grunt from cache
306 verbose get saving grunt to /Users/shaunstanislaus/.npm/registry.npmjs.org/grunt/.cache.json
307 http 304 http://registry.npmjs.org/jshint
308 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
308 verbose headers   via: '1.1 varnish',
308 verbose headers   'cache-control': 'max-age=60',
308 verbose headers   etag: '"APE2YPS3KEWRLJGKNPDJSLHFJ"',
308 verbose headers   age: '16',
308 verbose headers   connection: 'keep-alive',
308 verbose headers   'x-served-by': 'cache-sin6921-SIN',
308 verbose headers   'x-cache': 'HIT',
308 verbose headers   'x-cache-hits': '1',
308 verbose headers   'x-timer': 'S1444842413.222236,VS0,VE0',
308 verbose headers   vary: 'Accept' }
309 silly get cb [ 304,
309 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
309 silly get     via: '1.1 varnish',
309 silly get     'cache-control': 'max-age=60',
309 silly get     etag: '"APE2YPS3KEWRLJGKNPDJSLHFJ"',
309 silly get     age: '16',
309 silly get     connection: 'keep-alive',
309 silly get     'x-served-by': 'cache-sin6921-SIN',
309 silly get     'x-cache': 'HIT',
309 silly get     'x-cache-hits': '1',
309 silly get     'x-timer': 'S1444842413.222236,VS0,VE0',
309 silly get     vary: 'Accept' } ]
310 verbose etag http://registry.npmjs.org/jshint from cache
311 verbose get saving jshint to /Users/shaunstanislaus/.npm/registry.npmjs.org/jshint/.cache.json
312 http 304 http://registry.npmjs.org/JSONStream
313 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
313 verbose headers   via: '1.1 varnish',
313 verbose headers   'cache-control': 'max-age=60',
313 verbose headers   etag: '"CBJ0I3CJTQUU23PHUV2OWT75B"',
313 verbose headers   age: '7',
313 verbose headers   connection: 'keep-alive',
313 verbose headers   'x-served-by': 'cache-sin6924-SIN',
313 verbose headers   'x-cache': 'HIT',
313 verbose headers   'x-cache-hits': '1',
313 verbose headers   'x-timer': 'S1444842413.249948,VS0,VE0',
313 verbose headers   vary: 'Accept' }
314 silly get cb [ 304,
314 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
314 silly get     via: '1.1 varnish',
314 silly get     'cache-control': 'max-age=60',
314 silly get     etag: '"CBJ0I3CJTQUU23PHUV2OWT75B"',
314 silly get     age: '7',
314 silly get     connection: 'keep-alive',
314 silly get     'x-served-by': 'cache-sin6924-SIN',
314 silly get     'x-cache': 'HIT',
314 silly get     'x-cache-hits': '1',
314 silly get     'x-timer': 'S1444842413.249948,VS0,VE0',
314 silly get     vary: 'Accept' } ]
315 verbose etag http://registry.npmjs.org/JSONStream from cache
316 verbose get saving JSONStream to /Users/shaunstanislaus/.npm/registry.npmjs.org/JSONStream/.cache.json
317 http 304 http://registry.npmjs.org/less
318 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
318 verbose headers   via: '1.1 varnish',
318 verbose headers   'cache-control': 'max-age=60',
318 verbose headers   etag: '"BXE4R1F57H1LHECUL3J7HKRQ7"',
318 verbose headers   age: '55',
318 verbose headers   connection: 'keep-alive',
318 verbose headers   'x-served-by': 'cache-sin6926-SIN',
318 verbose headers   'x-cache': 'HIT',
318 verbose headers   'x-cache-hits': '1',
318 verbose headers   'x-timer': 'S1444842413.250353,VS0,VE0',
318 verbose headers   vary: 'Accept' }
319 silly get cb [ 304,
319 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
319 silly get     via: '1.1 varnish',
319 silly get     'cache-control': 'max-age=60',
319 silly get     etag: '"BXE4R1F57H1LHECUL3J7HKRQ7"',
319 silly get     age: '55',
319 silly get     connection: 'keep-alive',
319 silly get     'x-served-by': 'cache-sin6926-SIN',
319 silly get     'x-cache': 'HIT',
319 silly get     'x-cache-hits': '1',
319 silly get     'x-timer': 'S1444842413.250353,VS0,VE0',
319 silly get     vary: 'Accept' } ]
320 verbose etag http://registry.npmjs.org/less from cache
321 verbose get saving less to /Users/shaunstanislaus/.npm/registry.npmjs.org/less/.cache.json
322 http 304 http://registry.npmjs.org/express
323 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
323 verbose headers   via: '1.1 varnish',
323 verbose headers   'cache-control': 'max-age=60',
323 verbose headers   etag: '"OPZ5B9E5KKQFOJRL0T2D4NAJ"',
323 verbose headers   age: '35',
323 verbose headers   connection: 'keep-alive',
323 verbose headers   'x-served-by': 'cache-sin6927-SIN',
323 verbose headers   'x-cache': 'HIT',
323 verbose headers   'x-cache-hits': '1',
323 verbose headers   'x-timer': 'S1444842413.249056,VS0,VE1',
323 verbose headers   vary: 'Accept' }
324 silly get cb [ 304,
324 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
324 silly get     via: '1.1 varnish',
324 silly get     'cache-control': 'max-age=60',
324 silly get     etag: '"OPZ5B9E5KKQFOJRL0T2D4NAJ"',
324 silly get     age: '35',
324 silly get     connection: 'keep-alive',
324 silly get     'x-served-by': 'cache-sin6927-SIN',
324 silly get     'x-cache': 'HIT',
324 silly get     'x-cache-hits': '1',
324 silly get     'x-timer': 'S1444842413.249056,VS0,VE1',
324 silly get     vary: 'Accept' } ]
325 verbose etag http://registry.npmjs.org/express from cache
326 verbose get saving express to /Users/shaunstanislaus/.npm/registry.npmjs.org/express/.cache.json
327 http 304 http://registry.npmjs.org/mongoose
328 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
328 verbose headers   via: '1.1 varnish',
328 verbose headers   'cache-control': 'max-age=60',
328 verbose headers   etag: '"ELBMLIYCCQTWX9N6LG10KURW3"',
328 verbose headers   age: '14',
328 verbose headers   connection: 'keep-alive',
328 verbose headers   'x-served-by': 'cache-sin6926-SIN',
328 verbose headers   'x-cache': 'HIT',
328 verbose headers   'x-cache-hits': '1',
328 verbose headers   'x-timer': 'S1444842413.250450,VS0,VE1',
328 verbose headers   vary: 'Accept' }
329 silly get cb [ 304,
329 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
329 silly get     via: '1.1 varnish',
329 silly get     'cache-control': 'max-age=60',
329 silly get     etag: '"ELBMLIYCCQTWX9N6LG10KURW3"',
329 silly get     age: '14',
329 silly get     connection: 'keep-alive',
329 silly get     'x-served-by': 'cache-sin6926-SIN',
329 silly get     'x-cache': 'HIT',
329 silly get     'x-cache-hits': '1',
329 silly get     'x-timer': 'S1444842413.250450,VS0,VE1',
329 silly get     vary: 'Accept' } ]
330 verbose etag http://registry.npmjs.org/mongoose from cache
331 verbose get saving mongoose to /Users/shaunstanislaus/.npm/registry.npmjs.org/mongoose/.cache.json
332 http 304 http://registry.npmjs.org/strongloop
333 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
333 verbose headers   via: '1.1 varnish',
333 verbose headers   'cache-control': 'max-age=60',
333 verbose headers   etag: '"9ZIYP66GBN3INMZ5INBEO1PVA"',
333 verbose headers   age: '18',
333 verbose headers   connection: 'keep-alive',
333 verbose headers   'x-served-by': 'cache-sin6921-SIN',
333 verbose headers   'x-cache': 'HIT',
333 verbose headers   'x-cache-hits': '1',
333 verbose headers   'x-timer': 'S1444842413.225606,VS0,VE0',
333 verbose headers   vary: 'Accept' }
334 silly get cb [ 304,
334 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
334 silly get     via: '1.1 varnish',
334 silly get     'cache-control': 'max-age=60',
334 silly get     etag: '"9ZIYP66GBN3INMZ5INBEO1PVA"',
334 silly get     age: '18',
334 silly get     connection: 'keep-alive',
334 silly get     'x-served-by': 'cache-sin6921-SIN',
334 silly get     'x-cache': 'HIT',
334 silly get     'x-cache-hits': '1',
334 silly get     'x-timer': 'S1444842413.225606,VS0,VE0',
334 silly get     vary: 'Accept' } ]
335 verbose etag http://registry.npmjs.org/strongloop from cache
336 verbose get saving strongloop to /Users/shaunstanislaus/.npm/registry.npmjs.org/strongloop/.cache.json
337 http 304 http://registry.npmjs.org/grunt-cli
338 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
338 verbose headers   via: '1.1 varnish',
338 verbose headers   'cache-control': 'max-age=60',
338 verbose headers   etag: '"3GZDLQ4H10MQM4GE4EHHDBNBJ"',
338 verbose headers   age: '48',
338 verbose headers   connection: 'keep-alive',
338 verbose headers   'x-served-by': 'cache-sin6926-SIN',
338 verbose headers   'x-cache': 'HIT',
338 verbose headers   'x-cache-hits': '3',
338 verbose headers   'x-timer': 'S1444842413.262795,VS0,VE0',
338 verbose headers   vary: 'Accept' }
339 silly get cb [ 304,
339 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
339 silly get     via: '1.1 varnish',
339 silly get     'cache-control': 'max-age=60',
339 silly get     etag: '"3GZDLQ4H10MQM4GE4EHHDBNBJ"',
339 silly get     age: '48',
339 silly get     connection: 'keep-alive',
339 silly get     'x-served-by': 'cache-sin6926-SIN',
339 silly get     'x-cache': 'HIT',
339 silly get     'x-cache-hits': '3',
339 silly get     'x-timer': 'S1444842413.262795,VS0,VE0',
339 silly get     vary: 'Accept' } ]
340 verbose etag http://registry.npmjs.org/grunt-cli from cache
341 verbose get saving grunt-cli to /Users/shaunstanislaus/.npm/registry.npmjs.org/grunt-cli/.cache.json
342 http 304 http://registry.npmjs.org/babel-node-debug
343 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
343 verbose headers   via: '1.1 varnish',
343 verbose headers   'cache-control': 'max-age=60',
343 verbose headers   etag: '"DYB5NS29XNXLYS8MF7DRGGOI4"',
343 verbose headers   age: '0',
343 verbose headers   connection: 'keep-alive',
343 verbose headers   'x-served-by': 'cache-sin6920-SIN',
343 verbose headers   'x-cache': 'MISS',
343 verbose headers   'x-cache-hits': '0',
343 verbose headers   'x-timer': 'S1444842413.249139,VS0,VE212',
343 verbose headers   vary: 'Accept' }
344 silly get cb [ 304,
344 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
344 silly get     via: '1.1 varnish',
344 silly get     'cache-control': 'max-age=60',
344 silly get     etag: '"DYB5NS29XNXLYS8MF7DRGGOI4"',
344 silly get     age: '0',
344 silly get     connection: 'keep-alive',
344 silly get     'x-served-by': 'cache-sin6920-SIN',
344 silly get     'x-cache': 'MISS',
344 silly get     'x-cache-hits': '0',
344 silly get     'x-timer': 'S1444842413.249139,VS0,VE212',
344 silly get     vary: 'Accept' } ]
345 verbose etag http://registry.npmjs.org/babel-node-debug from cache
346 verbose get saving babel-node-debug to /Users/shaunstanislaus/.npm/registry.npmjs.org/babel-node-debug/.cache.json
347 http 304 http://registry.npmjs.org/babel
348 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
348 verbose headers   via: '1.1 varnish',
348 verbose headers   'cache-control': 'max-age=60',
348 verbose headers   etag: '"72G2692CXLT4AJ39ICR07LUAV"',
348 verbose headers   age: '0',
348 verbose headers   connection: 'keep-alive',
348 verbose headers   'x-served-by': 'cache-sin6922-SIN',
348 verbose headers   'x-cache': 'HIT',
348 verbose headers   'x-cache-hits': '1',
348 verbose headers   'x-timer': 'S1444842413.249689,VS0,VE213',
348 verbose headers   vary: 'Accept' }
349 silly get cb [ 304,
349 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
349 silly get     via: '1.1 varnish',
349 silly get     'cache-control': 'max-age=60',
349 silly get     etag: '"72G2692CXLT4AJ39ICR07LUAV"',
349 silly get     age: '0',
349 silly get     connection: 'keep-alive',
349 silly get     'x-served-by': 'cache-sin6922-SIN',
349 silly get     'x-cache': 'HIT',
349 silly get     'x-cache-hits': '1',
349 silly get     'x-timer': 'S1444842413.249689,VS0,VE213',
349 silly get     vary: 'Accept' } ]
350 verbose etag http://registry.npmjs.org/babel from cache
351 verbose get saving babel to /Users/shaunstanislaus/.npm/registry.npmjs.org/babel/.cache.json
352 http 304 http://registry.npmjs.org/node-pre-gyp
353 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
353 verbose headers   via: '1.1 varnish',
353 verbose headers   'cache-control': 'max-age=60',
353 verbose headers   etag: '"51PJ29TLKG5BZ0EPTUIVMCXQD"',
353 verbose headers   age: '0',
353 verbose headers   connection: 'keep-alive',
353 verbose headers   'x-served-by': 'cache-sin6923-SIN',
353 verbose headers   'x-cache': 'HIT',
353 verbose headers   'x-cache-hits': '1',
353 verbose headers   'x-timer': 'S1444842413.247593,VS0,VE213',
353 verbose headers   vary: 'Accept' }
354 silly get cb [ 304,
354 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
354 silly get     via: '1.1 varnish',
354 silly get     'cache-control': 'max-age=60',
354 silly get     etag: '"51PJ29TLKG5BZ0EPTUIVMCXQD"',
354 silly get     age: '0',
354 silly get     connection: 'keep-alive',
354 silly get     'x-served-by': 'cache-sin6923-SIN',
354 silly get     'x-cache': 'HIT',
354 silly get     'x-cache-hits': '1',
354 silly get     'x-timer': 'S1444842413.247593,VS0,VE213',
354 silly get     vary: 'Accept' } ]
355 verbose etag http://registry.npmjs.org/node-pre-gyp from cache
356 verbose get saving node-pre-gyp to /Users/shaunstanislaus/.npm/registry.npmjs.org/node-pre-gyp/.cache.json
357 http 304 http://registry.npmjs.org/nodemon
358 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
358 verbose headers   via: '1.1 varnish',
358 verbose headers   'cache-control': 'max-age=60',
358 verbose headers   etag: '"BQOK5XKL2XVJ1G33CPOUEQR2U"',
358 verbose headers   age: '0',
358 verbose headers   connection: 'keep-alive',
358 verbose headers   'x-served-by': 'cache-sin6921-SIN',
358 verbose headers   'x-cache': 'HIT',
358 verbose headers   'x-cache-hits': '1',
358 verbose headers   'x-timer': 'S1444842413.222834,VS0,VE214',
358 verbose headers   vary: 'Accept' }
359 silly get cb [ 304,
359 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
359 silly get     via: '1.1 varnish',
359 silly get     'cache-control': 'max-age=60',
359 silly get     etag: '"BQOK5XKL2XVJ1G33CPOUEQR2U"',
359 silly get     age: '0',
359 silly get     connection: 'keep-alive',
359 silly get     'x-served-by': 'cache-sin6921-SIN',
359 silly get     'x-cache': 'HIT',
359 silly get     'x-cache-hits': '1',
359 silly get     'x-timer': 'S1444842413.222834,VS0,VE214',
359 silly get     vary: 'Accept' } ]
360 verbose etag http://registry.npmjs.org/nodemon from cache
361 verbose get saving nodemon to /Users/shaunstanislaus/.npm/registry.npmjs.org/nodemon/.cache.json
362 http 304 http://registry.npmjs.org/yeoman-doctor
363 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
363 verbose headers   via: '1.1 varnish',
363 verbose headers   'cache-control': 'max-age=60',
363 verbose headers   etag: '"6NYMSIDXJCTY8S59O4AI0XD7H"',
363 verbose headers   age: '0',
363 verbose headers   connection: 'keep-alive',
363 verbose headers   'x-served-by': 'cache-sin6922-SIN',
363 verbose headers   'x-cache': 'HIT',
363 verbose headers   'x-cache-hits': '1',
363 verbose headers   'x-timer': 'S1444842413.262733,VS0,VE212',
363 verbose headers   vary: 'Accept' }
364 silly get cb [ 304,
364 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
364 silly get     via: '1.1 varnish',
364 silly get     'cache-control': 'max-age=60',
364 silly get     etag: '"6NYMSIDXJCTY8S59O4AI0XD7H"',
364 silly get     age: '0',
364 silly get     connection: 'keep-alive',
364 silly get     'x-served-by': 'cache-sin6922-SIN',
364 silly get     'x-cache': 'HIT',
364 silly get     'x-cache-hits': '1',
364 silly get     'x-timer': 'S1444842413.262733,VS0,VE212',
364 silly get     vary: 'Accept' } ]
365 verbose etag http://registry.npmjs.org/yeoman-doctor from cache
366 verbose get saving yeoman-doctor to /Users/shaunstanislaus/.npm/registry.npmjs.org/yeoman-doctor/.cache.json
367 http 304 http://registry.npmjs.org/yeoman-doctor
368 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
368 verbose headers   via: '1.1 varnish',
368 verbose headers   'cache-control': 'max-age=60',
368 verbose headers   etag: '"6NYMSIDXJCTY8S59O4AI0XD7H"',
368 verbose headers   age: '0',
368 verbose headers   connection: 'keep-alive',
368 verbose headers   'x-served-by': 'cache-sin6926-SIN',
368 verbose headers   'x-cache': 'HIT',
368 verbose headers   'x-cache-hits': '1',
368 verbose headers   'x-timer': 'S1444842413.262339,VS0,VE213',
368 verbose headers   vary: 'Accept' }
369 silly get cb [ 304,
369 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
369 silly get     via: '1.1 varnish',
369 silly get     'cache-control': 'max-age=60',
369 silly get     etag: '"6NYMSIDXJCTY8S59O4AI0XD7H"',
369 silly get     age: '0',
369 silly get     connection: 'keep-alive',
369 silly get     'x-served-by': 'cache-sin6926-SIN',
369 silly get     'x-cache': 'HIT',
369 silly get     'x-cache-hits': '1',
369 silly get     'x-timer': 'S1444842413.262339,VS0,VE213',
369 silly get     vary: 'Accept' } ]
370 verbose etag http://registry.npmjs.org/yeoman-doctor from cache
371 verbose get saving yeoman-doctor to /Users/shaunstanislaus/.npm/registry.npmjs.org/yeoman-doctor/.cache.json
372 http 304 http://registry.npmjs.org/treeline
373 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
373 verbose headers   via: '1.1 varnish',
373 verbose headers   'cache-control': 'max-age=60',
373 verbose headers   etag: '"CWORTQXFLSP25P3AGFYQS60MZ"',
373 verbose headers   age: '0',
373 verbose headers   connection: 'keep-alive',
373 verbose headers   'x-served-by': 'cache-sin6926-SIN',
373 verbose headers   'x-cache': 'HIT',
373 verbose headers   'x-cache-hits': '1',
373 verbose headers   'x-timer': 'S1444842413.253909,VS0,VE251',
373 verbose headers   vary: 'Accept' }
374 silly get cb [ 304,
374 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
374 silly get     via: '1.1 varnish',
374 silly get     'cache-control': 'max-age=60',
374 silly get     etag: '"CWORTQXFLSP25P3AGFYQS60MZ"',
374 silly get     age: '0',
374 silly get     connection: 'keep-alive',
374 silly get     'x-served-by': 'cache-sin6926-SIN',
374 silly get     'x-cache': 'HIT',
374 silly get     'x-cache-hits': '1',
374 silly get     'x-timer': 'S1444842413.253909,VS0,VE251',
374 silly get     vary: 'Accept' } ]
375 verbose etag http://registry.npmjs.org/treeline from cache
376 verbose get saving treeline to /Users/shaunstanislaus/.npm/registry.npmjs.org/treeline/.cache.json
377 http 304 http://registry.npmjs.org/vantage
378 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
378 verbose headers   via: '1.1 varnish',
378 verbose headers   'cache-control': 'max-age=60',
378 verbose headers   etag: '"1Q63LE1AFM5XBL6TRY675R85J"',
378 verbose headers   age: '0',
378 verbose headers   connection: 'keep-alive',
378 verbose headers   'x-served-by': 'cache-sin6923-SIN',
378 verbose headers   'x-cache': 'HIT',
378 verbose headers   'x-cache-hits': '1',
378 verbose headers   'x-timer': 'S1444842413.250823,VS0,VE256',
378 verbose headers   vary: 'Accept' }
379 silly get cb [ 304,
379 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
379 silly get     via: '1.1 varnish',
379 silly get     'cache-control': 'max-age=60',
379 silly get     etag: '"1Q63LE1AFM5XBL6TRY675R85J"',
379 silly get     age: '0',
379 silly get     connection: 'keep-alive',
379 silly get     'x-served-by': 'cache-sin6923-SIN',
379 silly get     'x-cache': 'HIT',
379 silly get     'x-cache-hits': '1',
379 silly get     'x-timer': 'S1444842413.250823,VS0,VE256',
379 silly get     vary: 'Accept' } ]
380 verbose etag http://registry.npmjs.org/vantage from cache
381 verbose get saving vantage to /Users/shaunstanislaus/.npm/registry.npmjs.org/vantage/.cache.json
382 http 304 http://registry.npmjs.org/cssfmt
383 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
383 verbose headers   via: '1.1 varnish',
383 verbose headers   'cache-control': 'max-age=60',
383 verbose headers   etag: '"6B0NHO1YCR2VFACUUDP28BXER"',
383 verbose headers   age: '0',
383 verbose headers   connection: 'keep-alive',
383 verbose headers   'x-served-by': 'cache-sin6924-SIN',
383 verbose headers   'x-cache': 'HIT',
383 verbose headers   'x-cache-hits': '1',
383 verbose headers   'x-timer': 'S1444842413.249417,VS0,VE264',
383 verbose headers   vary: 'Accept' }
384 silly get cb [ 304,
384 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
384 silly get     via: '1.1 varnish',
384 silly get     'cache-control': 'max-age=60',
384 silly get     etag: '"6B0NHO1YCR2VFACUUDP28BXER"',
384 silly get     age: '0',
384 silly get     connection: 'keep-alive',
384 silly get     'x-served-by': 'cache-sin6924-SIN',
384 silly get     'x-cache': 'HIT',
384 silly get     'x-cache-hits': '1',
384 silly get     'x-timer': 'S1444842413.249417,VS0,VE264',
384 silly get     vary: 'Accept' } ]
385 verbose etag http://registry.npmjs.org/cssfmt from cache
386 verbose get saving cssfmt to /Users/shaunstanislaus/.npm/registry.npmjs.org/cssfmt/.cache.json
387 http 304 http://registry.npmjs.org/jscs
388 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
388 verbose headers   via: '1.1 varnish',
388 verbose headers   'cache-control': 'max-age=60',
388 verbose headers   etag: '"1CH7UC3D1A40HWT8VLEX00D35"',
388 verbose headers   age: '0',
388 verbose headers   connection: 'keep-alive',
388 verbose headers   'x-served-by': 'cache-sin6926-SIN',
388 verbose headers   'x-cache': 'HIT',
388 verbose headers   'x-cache-hits': '1',
388 verbose headers   'x-timer': 'S1444842413.250072,VS0,VE265',
388 verbose headers   vary: 'Accept' }
389 silly get cb [ 304,
389 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
389 silly get     via: '1.1 varnish',
389 silly get     'cache-control': 'max-age=60',
389 silly get     etag: '"1CH7UC3D1A40HWT8VLEX00D35"',
389 silly get     age: '0',
389 silly get     connection: 'keep-alive',
389 silly get     'x-served-by': 'cache-sin6926-SIN',
389 silly get     'x-cache': 'HIT',
389 silly get     'x-cache-hits': '1',
389 silly get     'x-timer': 'S1444842413.250072,VS0,VE265',
389 silly get     vary: 'Accept' } ]
390 verbose etag http://registry.npmjs.org/jscs from cache
391 verbose get saving jscs to /Users/shaunstanislaus/.npm/registry.npmjs.org/jscs/.cache.json
392 http 404 http://registry.npmjs.org/npm-debug.log
393 verbose headers { 'content-type': 'application/json',
393 verbose headers   'cache-control': 'max-age=0',
393 verbose headers   'content-length': '2',
393 verbose headers   'accept-ranges': 'bytes',
393 verbose headers   date: 'Wed, 14 Oct 2015 17:06:54 GMT',
393 verbose headers   via: '1.1 varnish',
393 verbose headers   age: '0',
393 verbose headers   connection: 'keep-alive',
393 verbose headers   'x-served-by': 'cache-sin6923-SIN',
393 verbose headers   'x-cache': 'MISS',
393 verbose headers   'x-cache-hits': '0',
393 verbose headers   'x-timer': 'S1444842413.053569,VS0,VE1006' }
394 silly get cb [ 404,
394 silly get   { 'content-type': 'application/json',
394 silly get     'cache-control': 'max-age=0',
394 silly get     'content-length': '2',
394 silly get     'accept-ranges': 'bytes',
394 silly get     date: 'Wed, 14 Oct 2015 17:06:54 GMT',
394 silly get     via: '1.1 varnish',
394 silly get     age: '0',
394 silly get     connection: 'keep-alive',
394 silly get     'x-served-by': 'cache-sin6923-SIN',
394 silly get     'x-cache': 'MISS',
394 silly get     'x-cache-hits': '0',
394 silly get     'x-timer': 'S1444842413.053569,VS0,VE1006' } ]
395 http 304 http://registry.npmjs.org/sails
396 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
396 verbose headers   via: '1.1 varnish',
396 verbose headers   'cache-control': 'max-age=60',
396 verbose headers   etag: '"7B15DVBD7LHH07827X3MVFUT1"',
396 verbose headers   age: '0',
396 verbose headers   connection: 'keep-alive',
396 verbose headers   'x-served-by': 'cache-sin6926-SIN',
396 verbose headers   'x-cache': 'HIT',
396 verbose headers   'x-cache-hits': '1',
396 verbose headers   'x-timer': 'S1444842413.250697,VS0,VE856',
396 verbose headers   vary: 'Accept' }
397 silly get cb [ 304,
397 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
397 silly get     via: '1.1 varnish',
397 silly get     'cache-control': 'max-age=60',
397 silly get     etag: '"7B15DVBD7LHH07827X3MVFUT1"',
397 silly get     age: '0',
397 silly get     connection: 'keep-alive',
397 silly get     'x-served-by': 'cache-sin6926-SIN',
397 silly get     'x-cache': 'HIT',
397 silly get     'x-cache-hits': '1',
397 silly get     'x-timer': 'S1444842413.250697,VS0,VE856',
397 silly get     vary: 'Accept' } ]
398 verbose etag http://registry.npmjs.org/sails from cache
399 verbose get saving sails to /Users/shaunstanislaus/.npm/registry.npmjs.org/sails/.cache.json
400 http 304 http://registry.npmjs.org/brunch
401 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
401 verbose headers   via: '1.1 varnish',
401 verbose headers   'cache-control': 'max-age=60',
401 verbose headers   etag: '"A0TSRVQEK2NQ14MM1DTLAM0ND"',
401 verbose headers   age: '0',
401 verbose headers   connection: 'keep-alive',
401 verbose headers   'x-served-by': 'cache-sin6921-SIN',
401 verbose headers   'x-cache': 'MISS',
401 verbose headers   'x-cache-hits': '0',
401 verbose headers   'x-timer': 'S1444842413.221978,VS0,VE858',
401 verbose headers   vary: 'Accept' }
402 silly get cb [ 304,
402 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
402 silly get     via: '1.1 varnish',
402 silly get     'cache-control': 'max-age=60',
402 silly get     etag: '"A0TSRVQEK2NQ14MM1DTLAM0ND"',
402 silly get     age: '0',
402 silly get     connection: 'keep-alive',
402 silly get     'x-served-by': 'cache-sin6921-SIN',
402 silly get     'x-cache': 'MISS',
402 silly get     'x-cache-hits': '0',
402 silly get     'x-timer': 'S1444842413.221978,VS0,VE858',
402 silly get     vary: 'Accept' } ]
403 verbose etag http://registry.npmjs.org/brunch from cache
404 verbose get saving brunch to /Users/shaunstanislaus/.npm/registry.npmjs.org/brunch/.cache.json
405 http 304 http://registry.npmjs.org/npm
406 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
406 verbose headers   via: '1.1 varnish',
406 verbose headers   'cache-control': 'max-age=60',
406 verbose headers   etag: '"YMG7LMJXURZSL37T7C8446E9"',
406 verbose headers   age: '0',
406 verbose headers   connection: 'keep-alive',
406 verbose headers   'x-served-by': 'cache-sin6923-SIN',
406 verbose headers   'x-cache': 'HIT',
406 verbose headers   'x-cache-hits': '1',
406 verbose headers   'x-timer': 'S1444842413.250675,VS0,VE861',
406 verbose headers   vary: 'Accept' }
407 silly get cb [ 304,
407 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
407 silly get     via: '1.1 varnish',
407 silly get     'cache-control': 'max-age=60',
407 silly get     etag: '"YMG7LMJXURZSL37T7C8446E9"',
407 silly get     age: '0',
407 silly get     connection: 'keep-alive',
407 silly get     'x-served-by': 'cache-sin6923-SIN',
407 silly get     'x-cache': 'HIT',
407 silly get     'x-cache-hits': '1',
407 silly get     'x-timer': 'S1444842413.250675,VS0,VE861',
407 silly get     vary: 'Accept' } ]
408 verbose etag http://registry.npmjs.org/npm from cache
409 verbose get saving npm to /Users/shaunstanislaus/.npm/registry.npmjs.org/npm/.cache.json
410 http 304 http://registry.npmjs.org/yo
411 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
411 verbose headers   via: '1.1 varnish',
411 verbose headers   'cache-control': 'max-age=60',
411 verbose headers   etag: '"7E14URUC82U459C21UDRSP2T0"',
411 verbose headers   age: '0',
411 verbose headers   connection: 'keep-alive',
411 verbose headers   'x-served-by': 'cache-sin6924-SIN',
411 verbose headers   'x-cache': 'HIT',
411 verbose headers   'x-cache-hits': '1',
411 verbose headers   'x-timer': 'S1444842413.262399,VS0,VE869',
411 verbose headers   vary: 'Accept' }
412 silly get cb [ 304,
412 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
412 silly get     via: '1.1 varnish',
412 silly get     'cache-control': 'max-age=60',
412 silly get     etag: '"7E14URUC82U459C21UDRSP2T0"',
412 silly get     age: '0',
412 silly get     connection: 'keep-alive',
412 silly get     'x-served-by': 'cache-sin6924-SIN',
412 silly get     'x-cache': 'HIT',
412 silly get     'x-cache-hits': '1',
412 silly get     'x-timer': 'S1444842413.262399,VS0,VE869',
412 silly get     vary: 'Accept' } ]
413 verbose etag http://registry.npmjs.org/yo from cache
414 verbose get saving yo to /Users/shaunstanislaus/.npm/registry.npmjs.org/yo/.cache.json
415 http 304 http://registry.npmjs.org/express-generator
416 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
416 verbose headers   via: '1.1 varnish',
416 verbose headers   'cache-control': 'max-age=60',
416 verbose headers   etag: '"DC6D0QBZ1P150ODW8Y6TKATYF"',
416 verbose headers   age: '0',
416 verbose headers   connection: 'keep-alive',
416 verbose headers   'x-served-by': 'cache-sin6921-SIN',
416 verbose headers   'x-cache': 'HIT',
416 verbose headers   'x-cache-hits': '1',
416 verbose headers   'x-timer': 'S1444842413.222048,VS0,VE1002',
416 verbose headers   vary: 'Accept' }
417 silly get cb [ 304,
417 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
417 silly get     via: '1.1 varnish',
417 silly get     'cache-control': 'max-age=60',
417 silly get     etag: '"DC6D0QBZ1P150ODW8Y6TKATYF"',
417 silly get     age: '0',
417 silly get     connection: 'keep-alive',
417 silly get     'x-served-by': 'cache-sin6921-SIN',
417 silly get     'x-cache': 'HIT',
417 silly get     'x-cache-hits': '1',
417 silly get     'x-timer': 'S1444842413.222048,VS0,VE1002',
417 silly get     vary: 'Accept' } ]
418 verbose etag http://registry.npmjs.org/express-generator from cache
419 verbose get saving express-generator to /Users/shaunstanislaus/.npm/registry.npmjs.org/express-generator/.cache.json
420 http 304 http://registry.npmjs.org/generator-loopback
421 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
421 verbose headers   via: '1.1 varnish',
421 verbose headers   'cache-control': 'max-age=60',
421 verbose headers   etag: '"AJ8DMB3AW5NQ7NQFHG8F5N7D4"',
421 verbose headers   age: '0',
421 verbose headers   connection: 'keep-alive',
421 verbose headers   'x-served-by': 'cache-sin6927-SIN',
421 verbose headers   'x-cache': 'HIT',
421 verbose headers   'x-cache-hits': '1',
421 verbose headers   'x-timer': 'S1444842413.249052,VS0,VE1007',
421 verbose headers   vary: 'Accept' }
422 silly get cb [ 304,
422 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
422 silly get     via: '1.1 varnish',
422 silly get     'cache-control': 'max-age=60',
422 silly get     etag: '"AJ8DMB3AW5NQ7NQFHG8F5N7D4"',
422 silly get     age: '0',
422 silly get     connection: 'keep-alive',
422 silly get     'x-served-by': 'cache-sin6927-SIN',
422 silly get     'x-cache': 'HIT',
422 silly get     'x-cache-hits': '1',
422 silly get     'x-timer': 'S1444842413.249052,VS0,VE1007',
422 silly get     vary: 'Accept' } ]
423 verbose etag http://registry.npmjs.org/generator-loopback from cache
424 verbose get saving generator-loopback to /Users/shaunstanislaus/.npm/registry.npmjs.org/generator-loopback/.cache.json
425 http 304 http://registry.npmjs.org/node-gyp
426 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
426 verbose headers   via: '1.1 varnish',
426 verbose headers   'cache-control': 'max-age=60',
426 verbose headers   etag: '"EKRR1HRWG4UNBI6CFGJ0H257K"',
426 verbose headers   age: '0',
426 verbose headers   connection: 'keep-alive',
426 verbose headers   'x-served-by': 'cache-sin6922-SIN',
426 verbose headers   'x-cache': 'HIT',
426 verbose headers   'x-cache-hits': '1',
426 verbose headers   'x-timer': 'S1444842413.250339,VS0,VE1008',
426 verbose headers   vary: 'Accept' }
427 silly get cb [ 304,
427 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
427 silly get     via: '1.1 varnish',
427 silly get     'cache-control': 'max-age=60',
427 silly get     etag: '"EKRR1HRWG4UNBI6CFGJ0H257K"',
427 silly get     age: '0',
427 silly get     connection: 'keep-alive',
427 silly get     'x-served-by': 'cache-sin6922-SIN',
427 silly get     'x-cache': 'HIT',
427 silly get     'x-cache-hits': '1',
427 silly get     'x-timer': 'S1444842413.250339,VS0,VE1008',
427 silly get     vary: 'Accept' } ]
428 verbose etag http://registry.npmjs.org/node-gyp from cache
429 verbose get saving node-gyp to /Users/shaunstanislaus/.npm/registry.npmjs.org/node-gyp/.cache.json
430 http 304 http://registry.npmjs.org/ionic
431 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
431 verbose headers   via: '1.1 varnish',
431 verbose headers   'cache-control': 'max-age=60',
431 verbose headers   etag: '"7F6QII55NWTSUNMKTM0IFAXM3"',
431 verbose headers   age: '0',
431 verbose headers   connection: 'keep-alive',
431 verbose headers   'x-served-by': 'cache-sin6920-SIN',
431 verbose headers   'x-cache': 'HIT',
431 verbose headers   'x-cache-hits': '1',
431 verbose headers   'x-timer': 'S1444842413.250388,VS0,VE1015',
431 verbose headers   vary: 'Accept' }
432 silly get cb [ 304,
432 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
432 silly get     via: '1.1 varnish',
432 silly get     'cache-control': 'max-age=60',
432 silly get     etag: '"7F6QII55NWTSUNMKTM0IFAXM3"',
432 silly get     age: '0',
432 silly get     connection: 'keep-alive',
432 silly get     'x-served-by': 'cache-sin6920-SIN',
432 silly get     'x-cache': 'HIT',
432 silly get     'x-cache-hits': '1',
432 silly get     'x-timer': 'S1444842413.250388,VS0,VE1015',
432 silly get     vary: 'Accept' } ]
433 verbose etag http://registry.npmjs.org/ionic from cache
434 verbose get saving ionic to /Users/shaunstanislaus/.npm/registry.npmjs.org/ionic/.cache.json
435 http 304 http://registry.npmjs.org/webpack
436 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
436 verbose headers   via: '1.1 varnish',
436 verbose headers   'cache-control': 'max-age=60',
436 verbose headers   etag: '"8EDJM2GQ6JXB5T7RAR3SZOVES"',
436 verbose headers   age: '0',
436 verbose headers   connection: 'keep-alive',
436 verbose headers   'x-served-by': 'cache-sin6921-SIN',
436 verbose headers   'x-cache': 'HIT',
436 verbose headers   'x-cache-hits': '1',
436 verbose headers   'x-timer': 'S1444842413.241218,VS0,VE999',
436 verbose headers   vary: 'Accept' }
437 silly get cb [ 304,
437 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
437 silly get     via: '1.1 varnish',
437 silly get     'cache-control': 'max-age=60',
437 silly get     etag: '"8EDJM2GQ6JXB5T7RAR3SZOVES"',
437 silly get     age: '0',
437 silly get     connection: 'keep-alive',
437 silly get     'x-served-by': 'cache-sin6921-SIN',
437 silly get     'x-cache': 'HIT',
437 silly get     'x-cache-hits': '1',
437 silly get     'x-timer': 'S1444842413.241218,VS0,VE999',
437 silly get     vary: 'Accept' } ]
438 verbose etag http://registry.npmjs.org/webpack from cache
439 verbose get saving webpack to /Users/shaunstanislaus/.npm/registry.npmjs.org/webpack/.cache.json
440 http 304 http://registry.npmjs.org/zmail
441 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
441 verbose headers   via: '1.1 varnish',
441 verbose headers   'cache-control': 'max-age=60',
441 verbose headers   etag: '"3MM9M8AWFVQW1KMWIWUG0CLD2"',
441 verbose headers   age: '0',
441 verbose headers   connection: 'keep-alive',
441 verbose headers   'x-served-by': 'cache-sin6924-SIN',
441 verbose headers   'x-cache': 'MISS',
441 verbose headers   'x-cache-hits': '0',
441 verbose headers   'x-timer': 'S1444842413.262511,VS0,VE1016',
441 verbose headers   vary: 'Accept' }
442 silly get cb [ 304,
442 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
442 silly get     via: '1.1 varnish',
442 silly get     'cache-control': 'max-age=60',
442 silly get     etag: '"3MM9M8AWFVQW1KMWIWUG0CLD2"',
442 silly get     age: '0',
442 silly get     connection: 'keep-alive',
442 silly get     'x-served-by': 'cache-sin6924-SIN',
442 silly get     'x-cache': 'MISS',
442 silly get     'x-cache-hits': '0',
442 silly get     'x-timer': 'S1444842413.262511,VS0,VE1016',
442 silly get     vary: 'Accept' } ]
443 verbose etag http://registry.npmjs.org/zmail from cache
444 verbose get saving zmail to /Users/shaunstanislaus/.npm/registry.npmjs.org/zmail/.cache.json
445 http 304 http://registry.npmjs.org/sshync
446 verbose headers { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
446 verbose headers   via: '1.1 varnish',
446 verbose headers   'cache-control': 'max-age=60',
446 verbose headers   etag: '"DK45HJHVWUKG1YP67IJEJWSK6"',
446 verbose headers   age: '0',
446 verbose headers   connection: 'keep-alive',
446 verbose headers   'x-served-by': 'cache-sin6926-SIN',
446 verbose headers   'x-cache': 'MISS',
446 verbose headers   'x-cache-hits': '0',
446 verbose headers   'x-timer': 'S1444842413.252295,VS0,VE1037',
446 verbose headers   vary: 'Accept' }
447 silly get cb [ 304,
447 silly get   { date: 'Wed, 14 Oct 2015 17:06:53 GMT',
447 silly get     via: '1.1 varnish',
447 silly get     'cache-control': 'max-age=60',
447 silly get     etag: '"DK45HJHVWUKG1YP67IJEJWSK6"',
447 silly get     age: '0',
447 silly get     connection: 'keep-alive',
447 silly get     'x-served-by': 'cache-sin6926-SIN',
447 silly get     'x-cache': 'MISS',
447 silly get     'x-cache-hits': '0',
447 silly get     'x-timer': 'S1444842413.252295,VS0,VE1037',
447 silly get     vary: 'Accept' } ]
448 verbose etag http://registry.npmjs.org/sshync from cache
449 verbose get saving sshync to /Users/shaunstanislaus/.npm/registry.npmjs.org/sshync/.cache.json
450 verbose stack Error: Registry returned 404 for GET on http://registry.npmjs.org/npm-debug.log
450 verbose stack     at makeError (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:264:12)
450 verbose stack     at CachingRegistryClient.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:242:14)
450 verbose stack     at Request._callback (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:172:14)
450 verbose stack     at Request.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/request.js:198:22)
450 verbose stack     at emitTwo (events.js:87:13)
450 verbose stack     at Request.emit (events.js:172:7)
450 verbose stack     at Request.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1063:14)
450 verbose stack     at emitOne (events.js:82:20)
450 verbose stack     at Request.emit (events.js:169:7)
450 verbose stack     at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1009:12)
451 verbose statusCode 404
452 verbose pkgid npm-debug.log
453 verbose cwd /Users/shaunstanislaus
454 error Darwin 14.5.0
455 error argv "/Users/shaunstanislaus/homebrew/Cellar/node/4.2.1/bin/node" "/usr/local/bin/npm" "update" "-g"
456 error node v4.2.1
457 error npm  v3.3.8
458 error code E404
459 error 404 Registry returned 404 for GET on http://registry.npmjs.org/npm-debug.log
459 error 404
459 error 404 'npm-debug.log' is not in the npm registry.
459 error 404 You should bug the author to publish it (or use the name yourself!)
459 error 404
459 error 404 Note that you can also install from a
459 error 404 tarball, folder, http url, or git url.
460 verbose exit [ 1, true ]

ocaoimh commented Oct 17, 2015

Brilliant. Thanks!

helpful

Thank you so much!!!!! Your solution helps me solve this problem perfectly!

Gusbenz commented Oct 21, 2015

Thanks! This was helpful and useful! Again, thanks!

Thanks! This saved my day!! πŸ‘

njv commented Oct 29, 2015

Thank you!

mattsilv commented Nov 2, 2015

thank you. Worked well on OSX 10.10

Thanks πŸ‘

Thanks! πŸ‘

getting -bash: /usr/local/bin/npm: No such file or directory any ideas?

Thanks, but I had to do the following to get mine to install all the way:

cd ~
rm -rf /usr/local/lib/node_modules
brew uninstall node
brew install node --without-npm
echo prefix=~/.node >> ~/.npmrc
sudo chown -R $(whoami) /usr/local
brew link --overwrite  node
curl -L https://www.npmjs.com/install.sh | sh

Permission Denied will occur if calling curl from a directory you don't have write permissions. I didn't realize I was in the wrong directory at first and foolishly kept making that mistake while searching for solutions.

You sir ROCK

I actually fixed my npm with this:

brew postinstall node

http://forums.webhook.com/t/bash-npm-command-not-found-resolved/66/7

Thanks you!!

Boy, this makes me feel uneasy. All my hacking uses node/npm daily. I currently have the install from their site, done using the npm trick of not using admin directories: https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md

Brew doctor gives me the list of 110 /usr/local/include/node header files. Sigh.

So you promise that if I remove the node/npm site's install, along with the global npm modules, then do as suggested to use homebrew for managing node/npm .. mainly npm .. I'll be able to update both node and npm via homebrew safely?

You mention also deleting all the global installs. What about the --save and --save-dev local developer npm package installs? Do I have to also delete them? I.e. when I update them, will they fail, or just work, only global packages are at risk?

How in the world did we get into this mess! Sorry to be grouchy, and thanks for the help. A LOT! :)

Thought I'd make a note of this, as of right now:
node v5.1.0 && npm -v3.5.0

I just recently updated and I realized none of my global commands were working. Went through the lengthy process up top and ran into the issue with rif... something not working when curl'ing npm.

β€’ Fixed this by running suggested tip up above -> rm -rf ~/.npm
β€’ Then, curl'ed again which worked. Afterwards I would run npm outdated and kept seeing and npm ERR! addLocal ..../package....
β€’ Fixed this by running npm install -g npm@latest
β€’ Afterwards I was noticing failures when trying npm upgrade -g, even tried npm upgrade -g and it still didn't work
β€’ Fixed this by npm uninstalling global packages that didn't upgrade with the npm upgrade -g and reinstalling the global package (in other words anything showing up when running npm outdated -g)

I think it might have to do with how deps are handled in the newer versions because something I noticed was that any packages' deprecated deps were getting updated, this didn't happen before. Well, not a node expert so I'll leave the diagnosis to the pros.

neraliu commented Dec 1, 2015

super

mesut commented Dec 5, 2015

Thanks a lot

Worked for me

thanks lot!

rgiaccio commented Dec 7, 2015

Many thanks!

Cheers! Thank you!

Huuuuuge thanks! 🀘

Outstanding! πŸ‘

This worked for me. I just had to update the PATH in my .bash_profile as I did not have a .path file, and this walkthrough held my hand nicely as I did it: http://dandean.com/nodejs-npm-express-osx/

Thanks a lot! πŸ‘

Thanks πŸ˜„

Thanks!

great help guys, worked without any problems, thanks !

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'cache', 'clean' ]
2 info using npm@1.4.28
3 info using node@v0.10.37
4 verbose node symlink /usr/bin/node
5 error Error: EACCES, unlink '/home/trinisoft/.npm/accepts/1.2.13'
5 error { [Error: EACCES, unlink '/home/trinisoft/.npm/accepts/1.2.13']
5 error errno: 3,
5 error code: 'EACCES',
5 error path: '/home/trinisoft/.npm/accepts/1.2.13' }
6 error Please try running this command again as root/Administrator.
7 error System Linux 3.16.0-51-generic
8 error command "/usr/bin/node" "/usr/bin/npm" "cache" "clean"
9 error cwd /home/trinisoft/Desktop/mayankproject
10 error node -v v0.10.37
11 error npm -v 1.4.28
12 error path /home/trinisoft/.npm/accepts/1.2.13
13 error code EACCES
14 error errno 3
15 error stack Error: EACCES, unlink '/home/trinisoft/.npm/accepts/1.2.13'
16 verbose exit [ 3, true ]

hey can anyone help me immediately by adding query on my id themayankgoel.mg@gmail.com,....................plz help me!!!! !important

Really helped me out. Thanks :)

Thanks

iposton commented Jan 2, 2016

This worked for me as well. I don't understand why npm install -g npm deleted my npm without using sudo in the first place. These directions fixed my npm, but now when I install something I get a full width progress bar. and the install process looks different. not that it's overly important but did this happen to anyone else and do you happen to know why npm install looks different? maybe because I reinstalled node and everything is new and up to date now.

Red4x commented Jan 7, 2016

Thank you it does helped me πŸ’ƒ

aldorr commented Jan 13, 2016

Perfect!

Thanks!

Thx !!!... that solve my ploblem for "cannot find module 'asn1'" error when trying to run npm commands

Thank you for this! For anyone else struggling with where to add export PATH="$HOME/.node/bin:$PATH", I had to put the export in ~/.bash_profile.

I get this when I do brew install node --without-npm

Last 15 lines from /Users/freddiecabrera/Library/Logs/Homebrew/node/02.make:
         ^
In file included from ../deps/gtest/src/gtest-death-test.cc:34:
In file included from ../deps/gtest/include/gtest/gtest-death-test.h:41:
In file included from ../deps/gtest/include/gtest/internal/gtest-death-test-internal.h:40:
In file included from ../deps/gtest/include/gtest/internal/gtest-internal.h:40:
../deps/gtest/include/gtest/internal/gtest-port.h:259:10: fatal error: 'ctype.h' file not found
#include <ctype.h>   // for isspace, etc
         ^
1 error generated.
1 error generated.
make[1]: *** [/private/tmp/node20160128-4235-1ux7s39/node-v5.5.0/out/Release/obj.target/gtest/deps/gtest/src/gtest-port.o] Error 1
make[1]: *** [/private/tmp/node20160128-4235-1ux7s39/node-v5.5.0/out/Release/obj.target/gtest/deps/gtest/src/gtest-filepath.o] Error 1
1 error generated.
make[1]: *** [/private/tmp/node20160128-4235-1ux7s39/node-v5.5.0/out/Release/obj.target/gtest/deps/gtest/src/gtest-death-test.o] Error 1
make: *** [node] Error 2

READ THIS: https://git.io/brew-troubleshooting

Thank you so much. I am a Grunt noob and thought I was doomed. You rule!

thank you so much

paprende commented Feb 5, 2016

Works a charm. thanks

πŸ‘

Worked for me, thanks for the step by step guide!

This finally fixed issues I was dealing with with my node, brew and bower installs. Thank you so very much! :)

After the steps provided here, I added following

export PATH="$HOME/.npm-packages/bin:$PATH"

Otherwise npm pointed to the wrong location (set by npm installer)

I got permission denied when I removed the node_modules. Do I have to do this as sudo?

The process of @mmizutani solved my issue (I was stuck with -- npm: command not found --)
I think it's recommended to do a clean un-installation of the previous node.
brew uninstall node --force node

larssn commented Mar 23, 2016

This guide unfortunately results in npm being unable to update itself:
$> npm update npm -g
npm ERR! addLocal Could not install /private/var/folders/pm/8bjhd30n6glfm340_ff1ln3c0000gp/T/npm.65676/package

Check npm/npm#11385

Thank you so much, @mirontoli - your suggestion re: adding NPM to my dot files did the trick!

Also, for anybody who is struggling to update NPM, have you tried the latest suggestion from the NPM site:

Node comes with npm installed so you should have a version of npm. However, npm gets updated more frequently than Node does, so you'll want to make sure it's the latest version.
sudo npm install npm -g

I noticed that a number of people (most recently @larssn) were trying to update instead of install - might be worth a try.

aaleksa commented Apr 4, 2016

As mentioned @mirontoli
don't forget add into ~/.bash_profile this path:

export PATH="$HOME/.npm-packages/bin:$PATH"
otherwise it will not fin npm

Just a head up, brew install node --without-npm If it looks like it stuck, just wait a bit longer
mine took 15 mins to finish

+1 and yeah, node took days to install this time around.

Thanks!

curl -L https://www.npmjs.com/install.sh | sh KEPT giving me errors... if anyone else runs into this... update your PATH first, then run the script.

elchingon commented Apr 26, 2016

There were some libraries conflicting with my Homebrew install in my $PATH..
I uninstalled node completely, then ran brew doctor and resolved all the issues in brew.
I then reinstalled node with brew.
brew install node

brew link --overwrite --dry-run node

brew link --overwrite node
Finally I was able to install libraries with npm again... thanks for the support and sharing this.

vfweber commented Apr 27, 2016

worked like a charm! Thank you!

I wish I'd found this 20 hours ago! Thanks!

hbhakhra commented May 8, 2016

I've been struggling to get these instructions to work because I need to LTS version so I just gave up and decided to try the package from npmjs.org and that seems to be working great.

@mmizutani - your method is the only one that worked for me! Thank you for sharing it!

The solution by @sacwebdeveloper worked for me. Good advice to do cd ~ before starting to ensure you don't need sudo.

I used these steps to install node and npm from scratch on my new machine:

brew install node --without-npm
echo prefix=~/.node >> ~/.npmrc
curl -L https://www.npmjs.org/install.sh | sh
echo "export PATH=\"\$HOME/.node/bin:\$PATH\"" >> ~/.bash_profile
npm install -g npm@latest

Note that the last command comes from npm/npm#11385.

ashecret commented Jun 8, 2016

JUNE 8, 2016

I didn't have to install npm separately like I had to do before.

brew uninstall node to unintsall node
Use brew doctor to find any issue(s) and fix them.
I had to use brew prune to remove broken symlinks

Now brew install node to install node
Verify node and npm with node --version and npm --version

MarkEspinosa commented Jun 18, 2016

can someone please help me out here I tried doing the steps @briangordon provided but I'm getting

ms-M:~ z$ echo "export PATH="$HOME/.node/bin:$PATH"" >> /.bash_profile
ms-M:
z$ npm install -g npm@latest
-bash: /usr/local/bin/npm: No such file or directory

@MarkEspinosa, did you source your .bash_profile after modifying your path?

source ~/.bash_profile

You should be able to run the env command (env | grep PATH) and see that you've got the ~/.node/bin directory in your path.

@mirontoli Thank you! The export PATH="$HOME/.npm-packages/bin:$PATH" resolved my -bash: npm: command not found issue!

bySabi commented Jul 4, 2016

Fix npm bash completion with:

echo 'source ~/.node/lib/node_modules/npm/lib/utils/completion.sh' >> ~/.bash_profile
source ~/.bash_profile

dhcodes commented Jul 4, 2016

Thanks!

Why I got command not found in my zsh on my mac pro. This works fine on my Macbook.

thank you for this! Remember to curl in the home directory and not anywhere else otherwise you're npm installation will keep on failing.
From the above comments, adding export PATH="$HOME/.npm-packages/bin:$PATH" into your .bash_profile.

This is my 3rd attempt at completing this installation over the last year and I've been struggling with it over the last month (again). Finally, I found a viable solution. Thank you guys, where would I be without my own brewing company? Here is what I had to do to ultimatelly make it work:

Warning: Running OS X El Capitan v10.11.15 on Mac mini (Late 2014)

brew doctor
brew update
rm -rf /usr/local/lib/node_modules
brew uninstall node

*In response to the homebrew warning errors I ran:
brew doctor
sudo port uninstall node
sudo mv /opt/local ~/macports
brew prune
brew doctor

*Once brew doctor adviced everything was fine and dandy I proceeded:
brew install node --without-npm
brew link --overwrite node
echo prefix=~/.npm-packages >> ~/.npmrc
curl -L https://www.npmjs.com/install.sh | sudo sh
echo export PATH="$HOME/.node/bin:$PATH"
echo export PATH="$HOME/.npm-packages/bin:$PATH" >> ~/.bash_profile
source ~/.bash_profile
sudo npm install -g npm@latest

Success!

Once again, thank you for all your contributions. I know, I know! Apple threatened to launch an update to macOS in the fall and everything is going to go down the drain again. I will cross that river when I reach that shore, now I have to "ketchup" (;-D) with all the stuff I have fallen behind. Owe you a keg!

I following the instructions, fixed npm i and npm i any dependencies. Now, I am having a similar problem with using webpack. Any one know what is going wrong?

> cars2@1.0.0 start /Users/bmarshall/cars2
> webpack-dev-server

module.js:442
    throw err;
    ^

Error: Cannot find module 'webpack-dev-middleware'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/webpack-dev-server/lib/Server.js:3:28)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)

npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/Users/bmarshall/.npm-packages/bin/npm" "start"
npm ERR! node v6.2.2
npm ERR! npm  v3.10.5
npm ERR! code ELIFECYCLE
npm ERR! cars2@1.0.0 start: `webpack-dev-server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cars2@1.0.0 start script 'webpack-dev-server'.
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 cars2 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     webpack-dev-server
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs cars2
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls cars2
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/bmarshall/cars2/npm-debug.log

eno812 commented Aug 4, 2016

Hi,

I installed NPM ages ago and now I can't remember if I installed directly or via hombrew. When I run the command 'which npm' it returns this, /usr/local/bin/npm

Does that mean it was installed directly from npm or brew.

The command 'which node' returns this, /usr/local/bin/node

But I know that node is installed via brew also.

I think I need help to clean up my install of NPM. Any suggestions?

interglobalmedia commented Aug 4, 2016

Hi @eno812,

I am having npm issues with the -g flag, and came across this npm documentation: https://docs.npmjs.com/getting-started/fixing-npm-permissions. However, it resulted in even more questions on my part re fixing permissions. Specifically about altering my .profile (which I can't alter). So opened an issue in which I am asking whether I can create another profile just naming it differently and then using that. Waiting for their answer. But it might help you generally with your problem. You can also reach out to them directly via their repo if you have any other questions that might not be answerable by Homebrew. And as you said, you might not have installed with it. I originally was not able to because if I remember correctly, I THINK I had an issue installing Node with Homebrew. But I can't swear upon it. It was so long ago.

For those still struggling to the point of giving up hope in node, try using https://github.com/brock/node-reinstall.

It will reset your node environment and you will be able to go on with your life. ✨

I tried using homebrew to install node before and will strongly advise against it. The node-reinstall I mentioned above will get rid of falty installs, do a clean install and from there on you can rely on nvm to manage node versions... Peace!

Thanks!

numanayhan commented Aug 24, 2016

thank you my error is solved

Thanks! :)

al-apex commented Aug 25, 2016

In addition to the steps the author mentioned, I needed to modify my $PATH or my npm and my npm installed programs wouldn't run.

I added the following lines to my .bash_profile

export PATH="$HOME/.npm/bin:$PATH"
export PATH="$HOME/.npm-packages/bin:$PATH"

dmolesUC3 commented Sep 7, 2016

I don't have either a ~/.node/bin or ~/.npm/bin directory. Not sure where npm actually installed itself, though I do have a ~/.npm directory full of things (none of which is an executable called npm).

Monte9 commented Sep 12, 2016

Worked for me too although I had to install node and npm from the node website directly. Here is what I did:

  1. rm -rf /usr/local/lib/node_modules
  2. brew uninstall node
  3. Download and install node from here: https://nodejs.org/en/download/current/
  4. Add export PATH=$PATH:/usr/local/bin to your .bash_profile or .bashrc
    Hope this helps.

fanky10 commented Sep 20, 2016

Thanks!

igor972 commented Sep 24, 2016

Thanks <3

lamass commented Sep 29, 2016

UR the Best!
Thanks a Million!

semihsezer commented Oct 2, 2016

make sure to run "source ~/.bash_profile" after adding export PATH=$PATH:/usr/local/bin to your .bash_profile or .bashrc. This should be stated in the last step explicitly for dummies like me :)

thanks for this!

revelt commented Oct 6, 2016

"Before you start, make a note of any globally installed npm packages."

If you came here because your npm itself is broken, you won't be able to call npm commands to view globally installed packages.
Luckily, you can see all of them by checking the folder: /usr/local/lib/node_modules!

rluberda commented Oct 6, 2016

Worked on my issue too. Thanks!

Great ! it fixed my issue

I have a little bitt problem, when execute this command:

brew install node --without-npm

In the screen prints:

Warning: You are using OS X 10.12. We do not provide support for this pre-release version. You may encounter build failures or other breakages. ==> Downloading https://nodejs.org/dist/v5.2.0/node-v5.2.0.tar.gz Already downloaded: /Library/Caches/Homebrew/node-5.2.0.tar.gz ==> Downloading https://ssl.icu-project.org/files/icu4c/56.1/icu4c-56_1-src.tgz Already downloaded: /Library/Caches/Homebrew/node--icu4c-56.1.tgz ==> ./configure --prefix=/usr/local/Cellar/node/5.2.0 --without-npm --with-intl=small-icu ==> make install

And the system stopped on this step...

Worked. Thanks

myjeeed commented Oct 19, 2016

Had the same problem, and got it fixed! Thanks

On OS 10.12. Worked perfectly. Thanks!

ferbass commented Oct 28, 2016

thank you fix my issues :)

georgir commented Nov 8, 2016

This is completely negleting use-cases with multiple users on the system. This just leaves other users without npm, unless they also install it for themselves, which is a very bad approach in my opinion.
EDIT: At the very least, the guide may be improved by clearly distinguishing the system-wide one-time steps from the steps that each user must take before being able to use npm. It might also not be a terrible idea to create a bogus npm executable in the system path that displays a message informing the users of those steps.

Was struggling for almost a day and then I found this.

It Works. Thanks.

mraniki commented Nov 13, 2016

Thanks!

Thank you so much. After all day of trying, this worked for me. YOU'RE THE BEST.

Hi, tried this out and I'm getting this error...

npm
ERR! Darwin 15.6.0
npm
ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "watch"

npm ERR! node
v6.9.1
npm ERR!
npm v3.10.8
npm ERR!
file sh
npm
ERR! code ELIFECYCLE
npm
ERR! errno ENOENT
npm
ERR! syscall spawn

Not sure what I did wrong. Any help is greatly appreciated. Thanks

Thank you! You're a saver!

using npm start will spin processor to 140%

great!! thanks!

This worked perfectly. Thank you for this excellent guide.

TangHui123 commented Dec 16, 2016

export PATH="$HOME/.npm-packages/bin:$PATH"

I have add this to .bash_profile. and source .bash_profile.

npm -v but still shows"zsh: command not found: npm"

but export PATH="$HOME/.npm-packages/bin:$PATH" add ~/.zshrc work well

Oimah commented Dec 17, 2016

Worked but i can no longer run npm from vs code.

Amazing. Thanks for posting this

worked for Bash on Ubuntu on Windows 10 !!

thanks @aliwatters that worked for me!

eaglerockdude commented Jan 7, 2017

I tried it but got stuck on the brew's make install.. it would not finish...I have 100G of space on my HD.

finally had to just download the installer.

The info on deleting was useful for me though.

jbwl commented Feb 8, 2017

It worked, but when I try to npm update -g, this error is shown:

npm ERR! addLocal Could not install /private/var/folders/j9/45xyj_0x0h598hhp47zbl5ph0000gn/T/npm.56653/package

It worked, thank you! I worked on this for 3 hours, I appreciate your help.

Thanks a ton!

FYI brew install node --without-npm took 13 minutes to complete on my machine.

I'd advise adding the -v flag to monitor progress so you aren't wondering if it's frozen.

@fjarrett Thanks for the recommendation of using -v, great idea!

ylem commented Apr 14, 2017

Fix my problem, thanks * 10!

thank you fix my issues πŸ‘ ^__^

Thanks! saved my day πŸ‘

dlopez commented Jun 16, 2017

Dude! You rock!

opichon commented Jun 20, 2017

This doesn't work for me on OSX El Capitan 10.11.6. The ~.npm-packages/lib/node_modules/npm link in invalid.

olivier at Oliviers-iMac in ~/.npm-packages/lib/node_modules
$ ls -al ~/.npm-packages/bin/
total 8
drwxr-xr-x  3 olivier  staff  102 Jun 20 11:18 .
drwxr-xr-x  6 olivier  staff  204 Jun 20 11:18 ..
lrwxr-xr-x  1 olivier  staff   38 Jun 20 11:18 npm -> ../lib/node_modules/npm/bin/npm-cli.js

olivier at Oliviers-iMac in ~/.npm-packages/lib/node_modules
$ ls -al
total 8
drwxr-xr-x  3 olivier  staff  102 Jun 20 11:18 .
drwxr-xr-x  3 olivier  staff  102 Jun 20 11:18 ..
lrwxr-xr-x  1 olivier  staff   88 Jun 20 11:18 npm -> ../../../../../private/var/folders/4t/5jpfcscj7qn1d3h3yf43477c0000gn/T/npm.96631/package

There are 2 things wrong with that link: There is a /private/var/folder/4t/5.../T/ directory, but the relative paht of the link is incorrect. Second, in that directory there are lots of npm-xxxxx-xxxxxxxx sub-dirs, but no npm.96631/.

colbygk commented Jun 21, 2017

For the reasons already stated, the instructions above have not aged well. If you are starting fresh on a more recent version of OS X, a better solution is:

$ brew install node
$ npm install npm --global

This will correctly allow you to do global npm installs and provides an up-to-date version of npm.

squidbe commented Jun 23, 2017

@colbygk, Thanks, I spent hours getting nowhere till I saw your comment.

mhumeSF commented Jun 25, 2017

@colbygk πŸ‘

@colbygk πŸ‘

note if you have previously used these instructions, but have updated OSX, and are now trying to use the instructions that @colbygk posted, don't forget to edit your .npmrc and remove the prefix line.

nickbouton commented Jul 20, 2017

@Bradleycorn @colbygk Thanks for this! πŸ‘ Needed to re-map the prefix to get things working globally as expected.

Instructions here in addition to @colbygk's steps above worked for me.

Please stop saying if a solution worked for you. Just add an emoji πŸ‘ This keeps issues focused on the solution.

murich commented Sep 5, 2017

Tried all above and keep receiving shit like this
Error: Cannot find module '/private/var/folders/5p/mqsyqy3n1gs0ktbt20s2z_6w0000gn/T/npm.39067/package/bin/read-package-json.js'

igr commented Sep 26, 2017

Same as @murich

igr commented Sep 26, 2017

Just uninstall/install the node again using brew.

supreets commented Sep 29, 2017

I get this error when i try installing node.

#brew install node --without-npm

==> Downloading http://nodejs.org/dist/v0.10.29/node-v0.10.29.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/node/0.10.29 --without-npm
File "./configure", line 319
'''
^
SyntaxError: Missing parentheses in call to 'print'

READ THIS: https://github.com/Homebrew/homebrew/wiki/troubleshooting

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:353:in open_http': 422 Unprocessable Entity (GitHub::Error) from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:709:inbuffer_open'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:210:in block in open_loop' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:208:incatch'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:208:in open_loop' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:149:inopen_uri'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:689:in open' from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/open-uri.rb:30:inopen'
from /usr/local/Library/Homebrew/utils.rb:318:in open' from /usr/local/Library/Homebrew/utils.rb:350:inissues_matching'
from /usr/local/Library/Homebrew/utils.rb:378:in issues_for_formula' from /usr/local/Library/Homebrew/exceptions.rb:171:infetch_issues'
from /usr/local/Library/Homebrew/exceptions.rb:167:in issues' from /usr/local/Library/Homebrew/exceptions.rb:207:indump'
from /usr/local/Library/brew.rb:158:in rescue in <main>' from /usr/local/Library/brew.rb:66:in

Same error as @murich. Just download the pkg from the Node website, and install it. Done!

Just download the pkg from the Node website, and install it. Done!

Except when I want to update Node, or npm. Which I do, frequently, so that I’m up-to-date with security fixes.

For everything that plays nicely, and is played with nicely by, Homebrew, I do this once a week:

$ brew doctor; brew update; brew upgrade;

Now, for Node or npm or both, I have do something extra? Well, hurray.

mailcz8 commented Oct 17, 2017

My Mac has "El Capitan", and after I installed brew, then did "brew install node", my "npm" does not work and return following error. I searched online for all solution, I did delete/clean out node and reinstall, nothing work. Please help!!!

Log:
70 chang:~$npm appium@1.6.5
module.js:471
throw err;
^

Error: Cannot find module '/usr/local/lib/node_modules/npm/bin/node_modules/npm/bin/npm-cli.js'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:383:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:496:3

Same error as @murich

jace45 commented Oct 20, 2017

So I did everything, but then I started to get:
bash: usr/local/bin/npm no such file or directory

So then I made sure I had: export PATH="$HOME/.npm-packages/bin:$PATH" in my ~/.bash_profile (/.zshrc in my case)

Well that didn't work either so I added export PATH="$HOME/.node/bin:$PATH" why?? Cause that was a popular suggestion on this thread. Still no progress.

After more exploring and trying to get my npm to be found in the correct path...I said screw it. And did brew uninstall node --force node and then just reinstalled node the regular way...through the website: https://nodejs.org/en/ (mac) this was simple and it installed npm along with it...exactly in the location I wanted it to be as well.

I hope this saves someone some time.

Okay, guys. I found this because I had serious issues with my (brew-provided) npm.

In actuality, this guide just gave me the same error as @murich got, and I'm actually glad, because as it turns out, homebrew has been playing nice for quite a while here.

My problem was due to having hacked in a version of node@5 on top of the latest node after node@5 was actually discontinued by brew β€” it seems mostly because of exactly problems with npm β€” which fucked everything up royally.

My new setup, having removed any explicit prefix in ~/.npmrc, and just using the npm that comes along with the latest brewed node, works just perfectly. Remember that this fix is four years old, and stuff has changed since then.

On my setup, node and npm by brew work just perfectly, globally installed modules linked into $HOMEBREW_PREFIX/bin, man pages working, etc.

It may be better for me because I've chosen to install brew to ~/Library/Homebrew, but I can't be sure. For the record, though, I've used brew forever outside of /usr/local, and it's never ever not worked.

Here I have found one problem while applying this article. I was trying to install NPM separately not work in my case I have installed with node itself.

smit26 commented Nov 14, 2017

@jace45 - that worked very well! Thanks

webia1 commented Nov 16, 2017

If you use a node package manager (whatever it is), you should remove all installed versions like

brew uninstall --force node

Tkss!!!!!

ehwest commented Nov 17, 2017

Followed exactly; got this.

Error: No such file or directory @ rb_sysopen

vesper8 commented Dec 6, 2017

thanks for this.. maybe by 2020 we'll be able to use brew to install npm again

clondon commented Dec 8, 2017

Thanks for this Dan,
npm was driving me mad with all the little bits that need special attention. The problem with using this system is that there are some many dependencies interlinked in ways that a newbie (well me) just can't grasp at first, and that you couldn't even ask for help easily.
I'd ask why gulp watch-bs is not found in some theme, for instance, then be told do exactly what you said "npm update npm -g" to fix everything, which didn't work then you'd be digitally f#*'ed for the next week repeating the same old steps.
As we all know, doing the same again and expecting different results is a form of insanity.
Finally, a man who understood and offered a solution.

Many thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment