Skip to content

Instantly share code, notes, and snippets.

@briangershon
Created September 2, 2014 18:56
Show Gist options
  • Save briangershon/36824075ee64f1ddd2d6 to your computer and use it in GitHub Desktop.
Save briangershon/36824075ee64f1ddd2d6 to your computer and use it in GitHub Desktop.
Update node.js via Homebrew while keeping npm 1.x (fix for yeoman webapp generator which was failing under npm 2.x beta)
# various Yeoman generators (generator-webapp) are failing due to using npm 2.x beta with errors
# like "grunt 1.4.x" peer dependency not met (when in fact the dependency is met).
# fix for me was to upgrade node, but install npm separately, since upgrading node automatically installs latest npm which is 2.x
# to install latest node
brew update
brew install node --without-npm
# to install latest 1.x branch of npm
curl -L https://npmjs.org/install.sh > npm_install.sh
vim npm_install.sh
# find the line that say says: echo "install npm@latest" and change t="latest" line below to t="v1.4-latest"
chmod u+x npm_install.sh
./npm_install.sh
# Yeoman webapp generator now works fine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment