How run different versions of node.js in same time?

Active3 hr before
Viewed126 times

6 Answers


Step 7 — Unloading Node Version Manager , Step 2 — Installing Multiple Node.js Versions ,With nvm installed, you can now install and work with multiple versions of Node.js., Step 5 — Switching Between Node.js Versions

To get started, you will need to install the Node Version Manager, or nvm, on your system. You can install it manually by running the following command:

curl - o - https: // | bash
load more v

Meta Stack Overflow , Stack Overflow Public questions & answers , Stack Overflow help chat ,Stack Overflow en español

Check out this nice article on how to set it up/use it with different versions:

Check rebrec's comment below for instructions on how to use nvm

load more v

In this blog, we will get to know and learn about running multiple node js version on the same machine with NVM .,To overcome this problem, we can use the Node Version Manager (NVM). NVM allows installing multiple node js versions on the same machine and switching between the required node js version.,Multiple NodeJs version can be installed using the below command.,UnInstall the multiple NodeJs version

Verify Installation

nvm version
load more v

Usually, we work on different versions for our Node.js project and it’s hard to manage them, but fortunately, there is a tool called NVM(node version manager) which helps to manage your node version and switch between them according to your projects.,Switch Node Version: The switching between different node versions can be done using the following command:,How to update Node.js and NPM to next version ?,How to install the previous version of node.js and npm ?


$ nano~/.bashrc
load more v

Without a good tool, this would mean spending a lot of time and effort manually uninstalling and reinstalling Node versions and their global packages. Fortunately, there’s a better way!,When switching to a different version, nvm will make the node instance in your terminal symlink to the proper Node.js instance.,By running the above, nvm will install Node.js version 12.14.1, the corresponding npm version, and reinstall the global npm packages you had installed for the 10.18.1 version.,You can run a command directly for an installed version without switching the node variable:

With cURL:

curl - o - https: // | bash
load more v

I am sure that many of you are in the same situation that I am in with needing a different version of node for different projects and you don’t want to have to create a new virtual machine for each project just because of node. Luckily with nvm you can install multiple versions of Node on the same machine and switch between them with a simple command line call.,Now you can easily switch between Node versions and don’t have to worry about compatibility with your code not working on your installed Node version.,Installing Node packages is the same as you are used to. Nvm just switches out which version is referenced in your path variables.,The one downside to having multiple versions of Node installed is that you have to install the global packages for each version of node that you want them available to. There is no ability to share packages between versions. This means that it will take a bit more disk space but most node packages are fairly small so this should be a none issue.

Get a the list so you can see what is available

 $ nvm list available
load more v

Other "different-undefined" queries related to "How run different versions of node.js in same time?"