Update NodeJS and NPM to the latest versions.


Update NodeJS and NPM: Node js is a rapidly changing open source component. It can always happen that you started a project on version x and before you finished the project version x+1 was released. To cope up with this change the best way is to install the node version manager tool nvm. Using this tool it will be easier for you to switch between different versions of the node.

If at all you are still stuck and would like to upgrade to the latest version of node, we are listing a few commands which can be used to update your node js version.

nvm (macOS, Linux)

To install nvm you can use the installation script (requires git) using cURL:

$ curl https://raw.github.com/creationix/nvm/master/install.sh | sh

or wget:

$ wget -qO- https://raw.github.com/creationix/nvm/master/install.sh | sh

To download and install a specific node.js and npm version, use:

$ nvm install version_to_use

Then, you can switch to the installed version, using:

$ nvm use version_to_use

NVM is good for teams that work on multiple projects across different versions of node js in the same development environment.

Handling multiple projects across different node versions is a headache especially when you need to switch daily from one project to another. NVM helps you solve this problem by easily providing an option to update/switch to different nodejs versions.

If still not working for you try some commands mentioned in the article.

NVM for WIndows

Windows users can check the steps mentioned at NVM for Windows.

Happy coding!

Update NodeJS and NPM to the latest versions.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top