To see the available versions of Node.js (using nvm) and Angular CLI, you can follow these steps:
1. View Available Node.js Versions with nvm
nvm allows you to list all available Node.js versions that you can install. Run the following command in your terminal:
bash
nvm list-remote
This will display a long list of all the Node.js versions available for installation, including LTS (Long-Term Support) and non-LTS versions.
If you want to filter the list to only show LTS versions (which are recommended for most use cases), you can use:
bash
nvm list-remote | grep "Latest LTS"
Alternatively, if you're looking for the latest stable version of Node.js, you can use:
bash
nvm install --lts
This installs the latest LTS version of Node.js.
2. View Installed Node.js Versions
If you've already installed multiple versions of Node.js using nvm, you can view them with:
bash
nvm list
This will show all installed Node.js versions on your system, along with the currently active version (marked with ->).
3. View Available Angular CLI Versions
To see the available versions of the Angular CLI, you can use npm to query the npm registry for all published versions of the @angular/cli package:
bash
npm show @angular/cli versions
This will output an array of all the available Angular CLI versions. For example:
bash
[
'1.0.0',
'1.1.0',
...
'14.2.6',
'15.0.0'
]
4. Check Compatibility Between Node.js and Angular CLI
Before choosing a version, ensure compatibility between the Node.js version and the Angular CLI version. You can refer to the official Angular documentation for compatibility details: