NVM is nice. It sets up your $PATH for you, and it allows simple, isolated, stand-alone Node.js installs.
Until NVM officially supports io.js, here is how to shoehorn io.js into your NVM system so that you can access it easily. The trick is just to tell nvm
that you've installed "Node" version 1.0.1.
- Install NVM the usual way. Confirm that you are using v0.22.2:
nvm --version
# Output: 0.22.2 - Make sure it works by installing a Node.js version.
- Download io.js. I used the binary build for Linux. You could build your own too.
- Extract io.js anywhere:
cd ~/Downloads; tar xzvf iojs-v1.0.1-linux-x64.tar.gz
# (or wherever your download/build is) mkdir -p ~/.nvm/versions/node
mv iojs-v1.0.1-linux-x64/ ~/.nvm/versions/node/v1.0.1
# (or whatever your download/build is)- Confirm that nvm thinks "Node" v1.0.1 is installed:
nvm ls
# Output includes versions/node/v1.0.1 - Try it out.
nvm use v1
# Output: Now using node versions/node/v1.0.1node --version
# Output: v1.0.1iojs --version
# Output: v1.0.1
Now show off!
$ iojs
> things = new Set
{}
> things.add('boop')
{}
> things.add('bup')
{}
> for (thing of things)
... console.log(thing)
boop
bup
undefined
>