Programming
node.js software-update
Updated Fri, 26 Aug 2022 23:58:17 GMT

How do I update Node.js?


I did the following to update my npm:

npm update npm -g

But I have no idea how to update Node.js. Any suggestions? (I'm using Node.js 0.4.1 and want to update to Node.js 0.6.1.)




Solution

Use Node Version Manager (NVM)

It's a Bash script that lets you download and manage different versions of node. Full source code is here.

There is a separate project for nvm for Windows: github.com/coreybutler/nvm-windows

Below are the full steps to use NVM for multiple version of node on windows

  1. download nvm-setup.zip extract and install it.
  2. execute command nvm list available from cmd or gitbash or powershell, this will list all available version of node enter image description here
  3. use command nvm install version e.g. nvm install 12.14.0 to install on the machine
  4. last once installed use nvm use version to use newer version e.g. nvm use 12.14.0




Comments (5)

  • +0 – FYI, the command to run once having install NVM is 'nvm install <version>'. For example 'nvm install v0.8.7' — Aug 18, 2012 at 13:55  
  • +0 – You don't need this. Node is not Ruby. — May 03, 2015 at 13:00  
  • +0 – @SimonEast There is an nvm for windows: github.com/coreybutler/nvm-windows — Nov 18, 2015 at 10:45  
  • +5 – @PhilHannent as per NVM github page, they don't support NVM on windows, so one can say that "there is no official NVM for windows" — Nov 21, 2016 at 00:07  
  • +8 – For windows just download latest version and install it. It will be automatically updated to new version you downloaded. — Mar 25, 2019 at 04:54