DEV Community

Shaundai Person
Shaundai Person

Posted on • Edited on

How to switch to using new version of node using nvm

SWITCH TO A NEW VERSION (TEMPORARY)
If you want to switch to a new version of node temporarily, use the command
nvm use [version]

where version is the version number. For example, to switch to node 18.20.0, your command will be
nvm use 18.20.0

This will switch the node version until you close your IDE, and then it will restore the default version.

SWITCH TO A NEW VERSION (CHANGE DEFAULT)
If you'd like to change the default node version you're using so that you don't have to continue to change versions every time you re-open your IDE, use the keywords alias default with nvm like this:
nvm alias default [version]

where version is the version number. For example, to switch to node 18.20.0, your command will be
nvm alias default 18.20.0

Top comments (2)

Collapse
 
maroine_bourass profile image
Maroine bourass • Edited

how to install new version with nvm ?

Collapse
 
shaundai profile image
Shaundai Person