SorenD
SorenD

Reputation: 1

How to upgrade angular version while keeping angular/cli one

I'm struggling to install the right version of angular, I often get errors like This version of CLI is only compatible with Angular versions ^11.0.0-next || >=11.0.0 <12.0.0, but Angular version 9.1.1 was found instead.

I installed angular using npm -g install @angular/[email protected] (as package.json of the project said was necessary), but when i do ng --version in the project, I have

Angular CLI: 11.2.1
Node: 14.15.5
OS: win32 x64
Angular: 9.1.1

I don't really understand what's going on, any help would be greatly appreciated

Upvotes: 0

Views: 579

Answers (1)

Bansi29
Bansi29

Reputation: 1079

You can update angular CLI globally

  1. uninstall CLI
npm uninstall @angular/cli -g
  1. install CLI to specific version
npm install @angular/cli@~9.1.0 -g

Upvotes: 1

Related Questions