Step-by-Step Guide: Upgrading Angular CLI and Projects Using NVM for Node Management

2 min read

๐งฑ Consider your Initial Setup: What You Had
Old Angular CLI v13
Old Node.js
Existing Angular 13 project
๐ Step-by-Step Guide
1. Install NVM (Node Version Manager for Windows)
Download: https://github.com/coreybutler/nvm-windows/releases
Run
nvm-setup.exe
and complete installation.
โ Verify NVM
nvm version
2. Install & Use Supported Node.js Version
Angular 17 supports Node.js v20
.
nvm install 20
nvm use 20
node -v # Should show v20.x.x
npm -v # Should show v10.x.x or v9.x.x
3. Uninstall Old Angular CLI (If Installed)
npm uninstall -g @angular/cli
4. Install Angular CLI v17 Globally
npm install -g @angular/cli@17
๐ฆ Clean NPM Cache (Optional)
npm cache clean --force
5. Upgrade Angular 13 Project to Angular 17
๐ Go to your project folder
cd path/to/your-angular-project
๐ Update Angular core & CLI
ng update @angular/core@17 @angular/cli@17
๐ Note: You may see additional suggestions โ follow them one by one (like updating Angular Material or other dependencies).
6. Verify Everything
ng version
โ Expected Output:
Angular CLI: 17.x.x
Angular: 17.x.x
Node: 20.x.x
๐ Bonus Commands
๐งน Clean Project Before Build (Optional)
rm -rf node_modules package-lock.json
npm install
๐ Switching Node Versions Anytime
nvm use 20 # Use Node.js v20
nvm use 14 # Example: switch to Node.js v14 if needed
โ You are now set up for future Angular projects and upgrades using NVM and CLI version management.
0
Subscribe to my newsletter
Read articles from Nagesh Bulbule directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Nagesh Bulbule
Nagesh Bulbule
Hi, I'm developer who loves coding and learning new things.