Skip to content

Instantly share code, notes, and snippets.

@jhs
Last active August 29, 2015 14:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhs/e29056322286c156f474 to your computer and use it in GitHub Desktop.
Save jhs/e29056322286c156f474 to your computer and use it in GitHub Desktop.
How to shoehorn io.js into nvm

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.

  1. Install NVM the usual way. Confirm that you are using v0.22.2: nvm --version # Output: 0.22.2
  2. Make sure it works by installing a Node.js version.
  3. Download io.js. I used the binary build for Linux. You could build your own too.
  4. Extract io.js anywhere: cd ~/Downloads; tar xzvf iojs-v1.0.1-linux-x64.tar.gz # (or wherever your download/build is)
  5. mkdir -p ~/.nvm/versions/node
  6. mv iojs-v1.0.1-linux-x64/ ~/.nvm/versions/node/v1.0.1 # (or whatever your download/build is)
  7. Confirm that nvm thinks "Node" v1.0.1 is installed: nvm ls # Output includes versions/node/v1.0.1
  8. Try it out.
  9. nvm use v1 # Output: Now using node versions/node/v1.0.1
  10. node --version # Output: v1.0.1
  11. iojs --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
> 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment