The recipe described below works fine in OS X El Capitan and Homebrew tool.
Fine tested with node@4.1
and npm@3.3.4
.
brew unlink iojs
brew uninstall iojs
brew unlink node
brew uninstall node
brew update
brew install node
cd /usr/local/lib/node_modules/npm
npm install npm
cd /usr/local/lib/node_modules/npm
$ npm install npm
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "npm"
npm ERR! node v4.5.0
npm ERR! npm v3.10.3
npm ERR! code ENOSELF
npm ERR! Refusing to install npm as a dependency of itself
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! /usr/local/lib/node_modules/npm/npm-debug.log
holbmac0132:npm sebastien.cheung$ npm install npm
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "npm"
npm ERR! node v4.5.0
npm ERR! npm v3.10.3
npm ERR! code ENOSELF
npm ERR! Refusing to install npm as a dependency of itself
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! /usr/local/lib/node_modules/npm/npm-debug.log