4

As $title says, I want to install io.js with brew on Yosemite. In my system there is no need for Node.js, and I want to avoid unnecessary programs.

But.. When I run brew install iojs I see it will be built with --without-npm option, and as the post-install text clarifies, it needs a patched npm.

Although I searched for the solution, the only thing that came across is how to run io.js and Node.js side-by-side, and that's not what I'm looking for.

I see there is an npm package for brew, but it's part of the node package.

How can I install iojs+npm without node?

inoirawus
  • 63
  • 4

3 Answers3

3
  1. Install nvm (node version manager) using brew:

    brew update
    brew install nvm
    source $(brew --prefix nvm)/nvm.sh
    

    Add the last command to the .profile, .bashrc or .zshrc file to not run it again on every terminal start. So for example to add it to the .profile run:

    echo "source $(brew --prefix nvm)/nvm.sh" >> ~/.profile
    
  2. Using nvm you can install any version of node or io.js you want. So to install the latest version of iojs do:

    nvm install iojs
    

npm is shipping with iojs so you don't need to install it manually.

Related question: What is the suggested way to install brew, node.js, io.js, nvm, npm on OS X?

Community
  • 1
  • 1
alexpods
  • 47,475
  • 10
  • 100
  • 94
  • 4
    `nvm` is an other thing I want to avoid. `brew` is fully capable to get and update the latest version of `iojs`. I don't want to maintain, manually update and then configure to be the default version of `iojs`. it's just a plus abstraction level for me, nothing else. – inoirawus Mar 21 '15 at 19:56
1

I've had the same problem: homebrew doesn't seem to properly explain how to get that "patched" npm in a clean way.

Anyway, nothing has worked for me better than getting that pkg from iojs.org, which includes npm.

(I'm referring to iojs v2.0.0)

Pierre Prinetti
  • 9,092
  • 6
  • 33
  • 49
1

It might be late but you can just use brew unlink node && brew link iojs --force I avoided nvm because it was way too slow for me

Mohibeyki
  • 459
  • 6
  • 16