Bird
0
0

You want to update Angular CLI to the latest version globally. Which sequence of commands is correct?

hard📝 Application Q9 of 15
Angular - Fundamentals
You want to update Angular CLI to the latest version globally. Which sequence of commands is correct?
Anpm uninstall -g @angular/cli && npm cache verify && npm install -g @angular/cli@latest
Bng update @angular/cli --global
Cnpm update -g angular-cli
Dnpm install -g @angular/cli --force
Step-by-Step Solution
Solution:
  1. Step 1: Properly uninstall old Angular CLI

    Uninstalling old CLI globally avoids conflicts.
  2. Step 2: Clear npm cache and install latest CLI

    Running npm cache verify cleans cache, then install latest CLI globally.
  3. Final Answer:

    npm uninstall -g @angular/cli && npm cache verify && npm install -g @angular/cli@latest -> Option A
  4. Quick Check:

    Update Angular CLI globally = uninstall, cache verify, install latest [OK]
Quick Trick: Uninstall old CLI before installing latest globally [OK]
Common Mistakes:
  • Using ng update globally
  • Wrong package name
  • Using --force without uninstall

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes