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

Nagesh BulbuleNagesh Bulbule
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)

โœ… 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.