I currently have the following versions installed my windows machine.
node : v7.3.0 npm : 3.10.10 @angular/cli : 1.4.2
I would like to install latest versions of the above and be able to switch accordingly. To my knowledge installation of node governs that. If I need to install latest npm and angular cli then i would need to install the latest version of node. Please do correct me if I am wrong. Can i globally install the latest version of nodejs. Once I install that could i switch between the node versions. I presume switching between the node versions would take care to use the appropriate npm and cli.
As on the same machine, we can only install one version of the nodejs, so it's very painful to uninstall and install the new node version as per your project requirements. To overcome this problem, we can use the Node Version Manager (NVM).
Before installing the latest package, ensure that you cleanup your environment first: Uninstall existing Node instances and remove existing installation directories. Uninstall existing npm install location (e.g. “C:\Users<user>\AppData\Roaming\npm”) Download the latest version of nvm for Windows and install it.
You have the latest and greatest version of Node. js installed, and the project you're about to work on requires an older version. In those situations, the Node Version Manager (nvm) is a great tool to use, allowing you to install multiple versions of Node. js and switch between them as you see fit.
This is achievable via various version managers.
For Windows, take a look at NVM for Windows.
For macOS or Linux (not your OS, I see, but for others reading), I like n, and NVM is also widely used.
nvm-windows let's you do that. Before installing nvm-windows, please uninstall all Node
versions from your computer.
To install any Node
version, type in command prompt nvm install [node version]
, like for example:
nvm install 10.16.0
nvm install 6.11.0
nvm list
lists all Node
versions you installed:
nvm use 6.11.0
or
nvm use [version name]
and you will be prompted by a windows pop up to allow nvm-windows to use/switch to a particular Node
version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With