Install different versions of NodeJS

node.jsVersion

node.js Problem Overview


Is it possible to have different versions of NodeJS installed on the same machine?

node.js Solutions


Solution 1 - node.js

There are several node managers which you can use to achieve this, but the most popular are:

Solution 2 - node.js

I use nave. https://github.com/isaacs/nave

> npm install -g nave
> nave use 0.4.12 # starts a subshell with 0.4.12 at the head of the path
> node --version
v0.4.12
> exit # go back to the original shell
> nave use 0.6.5
> node --version
v0.6.5
> nave usemain

Note that the first time you need a version, it will be downloaded and compiled for you.

Solution 3 - node.js

If you need something simple, the n utility is just for you.

Install it (use sudo prefix in commands if required):

npm -g install n

then :

npm cache clean -f

(don't be scared about the warning)

then just ask n to (download if required and) use the version you specify. For instance:

n 0.11.13

Et voilĂ  !

Should you install multiple versions, you'll be able to switch between them. See the [n page][1] for details.

[1]: https://github.com/visionmedia/n "n page"

Solution 4 - node.js

You can follow simple approach here

step1:

 $ curl https://raw.githubusercontent.com/creationix/nvm/v0.11.1/install.sh | bash

step2:

 $ source ~/.profile

step3: list the latest versions of node

 $ nvm ls-remote

step4:

  $  nvm install 7.10.0

step5: Create alias as default for node version

$ nvm alias default 7.10.0

step6:

$node --version

that's it.

Solution 5 - node.js

Windows users check out nvmw here.

You can go quite a long way down trying to install some of the other versions listed before realising there's no Windows support.

e.g. on the page for nave

> It will probably never work on Windows, or other systems lack a native > Bourne Again Shell. Sorry.

Solution 6 - node.js

The best option is node version manager NVM is very simple to install and you can change from one version to another with a simple nvm use command.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionXitrumView Question on Stackoverflow
Solution 1 - node.jsalessioalexView Answer on Stackoverflow
Solution 2 - node.jsMarcoView Answer on Stackoverflow
Solution 3 - node.jsJérôme BeauView Answer on Stackoverflow
Solution 4 - node.jsVenkateshView Answer on Stackoverflow
Solution 5 - node.jshawbslView Answer on Stackoverflow
Solution 6 - node.jsJohel AlvarezView Answer on Stackoverflow