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.
Is there a project level way to specify nvm versions and avoid nvm use?
Do you use nvm?
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.
» npm install nvm
I love the node version manager, since different projects might require different node versions for various reasons - often the CI/CD tooling or cloud infrastructure requirements.
The problem I have is when switching between projects, I need to remember to run nvm use.
To make sure I don't forget, I fill in the engines section like this:
"engines" : {"npm" : ">=8.0.0 <9.0.0","node" : ">=18.0.0 <19.0.0"
}
However, is there a nicer way where I don't have to switch, and somehow things are symlinked to the right place.
I use Windows out of habit, but happy for a Linux answer as I am happy to work there too.
Why?
I'm not sure if to install it again given that you can use npx to run code using a different Node.js version.
https://nodejs.dev/learn/the-npx-nodejs-package-runner
nvm (Node Version Manager) is a tool that allows you to download and install Node.js. Check if you have it installed via nvm --version.
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.26.1/install.sh | bash
npm (Node Package Manager) is a tool that allows you to install javascript packages. Check if you have it installed via npm --version.
npm comes with Node.js so if you have node installed (node --version) you most likely have npm installed as well.
You don't need nvm unless you want to keep multiple versions of Node.js installed on your system or if you'd like to upgrade your version.
nvm as you said is an "active" nodejs version manager. You can have multiple versions of node on the same machine and switch by doing "nvm use version". npm respects nvm if it is present on the machine, meaning if you have 0.12.7 active and do npm install -g uuid, it will install it globally under 0.12.7 but if you switch to 4.0.0, uuid will no longer be globally available.
In any case you do not necessarily need nvm to install packages.