Show current installed version
nvm current shows you the current version you have installed.
C:\>nvm current
v18.13.0
Show all available versions
nvm list available shows you a partial list of all available versions there are.
C:\>nvm list available
| CURRENT | LTS | OLD STABLE | OLD UNSTABLE |
|--------------|--------------|--------------|--------------|
| 19.5.0 | 18.13.0 | 0.12.18 | 0.11.16 |
| 19.4.0 | 18.12.1 | 0.12.17 | 0.11.15 |
| 19.3.0 | 18.12.0 | 0.12.16 | 0.11.14 |
| 19.2.0 | 16.19.0 | 0.12.15 | 0.11.13 |
| 19.1.0 | 16.18.1 | 0.12.14 | 0.11.12 |
| 19.0.1 | 16.18.0 | 0.12.13 | 0.11.11 |
| 19.0.0 | 16.17.1 | 0.12.12 | 0.11.10 |
| 18.11.0 | 16.17.0 | 0.12.11 | 0.11.9 |
| 18.10.0 | 16.16.0 | 0.12.10 | 0.11.8 |
| 18.9.1 | 16.15.1 | 0.12.9 | 0.11.7 |
| 18.9.0 | 16.15.0 | 0.12.8 | 0.11.6 |
| 18.8.0 | 16.14.2 | 0.12.7 | 0.11.5 |
| 18.7.0 | 16.14.1 | 0.12.6 | 0.11.4 |
| 18.6.0 | 16.14.0 | 0.12.5 | 0.11.3 |
| 18.5.0 | 16.13.2 | 0.12.4 | 0.11.2 |
| 18.4.0 | 16.13.1 | 0.12.3 | 0.11.1 |
| 18.3.0 | 16.13.0 | 0.12.2 | 0.11.0 |
| 18.2.0 | 14.21.2 | 0.12.1 | 0.9.12 |
| 18.1.0 | 14.21.1 | 0.12.0 | 0.9.11 |
| 18.0.0 | 14.21.0 | 0.10.48 | 0.9.10 |
This is a partial list. For a complete list, visit https://nodejs.org/en/download/releases
Stable vs. experimental versions
Versions with even numbers such as 18.x are stable.
Versions with odd numbers such as 19.x are unstable/experimental.
See https://nodejs.org/en/
Install latest LTS version
LTS (Long Term Support) is the stable version.
Depending on platform, either nvm install lts on Windows or nvm install --lts on Linux installs the latest LTS version.
Select installed version
If you had, say, 17.x installed, you now also have, say, 18.x installed.
Now, you need to select the newly installed version with nvm use 18.13.0.
Videos
Show current installed version
nvm current shows you the current version you have installed.
C:\>nvm current
v18.13.0
Show all available versions
nvm list available shows you a partial list of all available versions there are.
C:\>nvm list available
| CURRENT | LTS | OLD STABLE | OLD UNSTABLE |
|--------------|--------------|--------------|--------------|
| 19.5.0 | 18.13.0 | 0.12.18 | 0.11.16 |
| 19.4.0 | 18.12.1 | 0.12.17 | 0.11.15 |
| 19.3.0 | 18.12.0 | 0.12.16 | 0.11.14 |
| 19.2.0 | 16.19.0 | 0.12.15 | 0.11.13 |
| 19.1.0 | 16.18.1 | 0.12.14 | 0.11.12 |
| 19.0.1 | 16.18.0 | 0.12.13 | 0.11.11 |
| 19.0.0 | 16.17.1 | 0.12.12 | 0.11.10 |
| 18.11.0 | 16.17.0 | 0.12.11 | 0.11.9 |
| 18.10.0 | 16.16.0 | 0.12.10 | 0.11.8 |
| 18.9.1 | 16.15.1 | 0.12.9 | 0.11.7 |
| 18.9.0 | 16.15.0 | 0.12.8 | 0.11.6 |
| 18.8.0 | 16.14.2 | 0.12.7 | 0.11.5 |
| 18.7.0 | 16.14.1 | 0.12.6 | 0.11.4 |
| 18.6.0 | 16.14.0 | 0.12.5 | 0.11.3 |
| 18.5.0 | 16.13.2 | 0.12.4 | 0.11.2 |
| 18.4.0 | 16.13.1 | 0.12.3 | 0.11.1 |
| 18.3.0 | 16.13.0 | 0.12.2 | 0.11.0 |
| 18.2.0 | 14.21.2 | 0.12.1 | 0.9.12 |
| 18.1.0 | 14.21.1 | 0.12.0 | 0.9.11 |
| 18.0.0 | 14.21.0 | 0.10.48 | 0.9.10 |
This is a partial list. For a complete list, visit https://nodejs.org/en/download/releases
Stable vs. experimental versions
Versions with even numbers such as 18.x are stable.
Versions with odd numbers such as 19.x are unstable/experimental.
See https://nodejs.org/en/
Install latest LTS version
LTS (Long Term Support) is the stable version.
Depending on platform, either nvm install lts on Windows or nvm install --lts on Linux installs the latest LTS version.
Select installed version
If you had, say, 17.x installed, you now also have, say, 18.x installed.
Now, you need to select the newly installed version with nvm use 18.13.0.
nvm install --lts installs the latest LTS version.
Then, nvm use lts/* switches to the latest LTS version.
This may work:
nvm install NEW_VERSION --reinstall-packages-from=OLD_VERSION
For example:
nvm install 6.7 --reinstall-packages-from=6.4
then, if you want, you can delete your previous version with:
nvm uninstall OLD_VERSION
Where, in your case, NEW_VERSION = 5.4 OLD_VERSION = 5.0
Alternatively, try:
nvm install node --reinstall-packages-from=current
Or you can update to the last long-term support version with
nvm install lts --reinstall-packages-from=current
You can more simply run one of the following commands:
Latest version:
nvm install node --reinstall-packages-from=node
Stable (LTS) version: (if currently in use)
nvm install "lts/*" --reinstall-packages-from="$(nvm current)"
This will install the appropriate version and reinstall all packages from the currently used node version.
This saves you from manually handling the specific versions.
Kudos to @m4js7er for commenting about the LTS version.
(nvm maintainer here)
nvm alias default 6.11.5 if you want it pegged to that specific version.
You can also do nvm alias default 16 or nvm alias default node.
Either way, you'll want to upgrade to the latest version of nvm (v0.39.2 as of this writing)
# nvm set default node.js version 16.14.2
$ nvm alias default 16.14.2
$ nvm use
$ node -v
# v16.14.2
Lets say to want to make default version as 10.19.0.
nvm alias default v10.19.0
But it will give following error
! WARNING: Version 'v10.19.0' does not exist.
default -> v10.19.0 (-> N/A)
In That case you need to run two commands in the following order
# Install the version that you would like
nvm install 10.19.0
# Set 10.19.0 (or another version) as default
nvm alias default 10.19.0