1
     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 13.1.1
Node: 14.15.4
Package Manager: npm 6.14.10
OS: win32 x64

Angular: undefined
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1301.1
@angular-devkit/core         13.1.1
@angular-devkit/schematics   13.1.1
@angular/cli                 13.1.1
@schematics/angular          13.1.1

So I did:

npm uninstall -g @angular/cli

-> confirming with ng --version that it has been removed. It has.

npm cache clean --force

then npm install -g @angular/cli@11

I also repeaded the steps and then ran npm install -g @angular/cli@11.0.0 at the end.

But I keep getting the same result as posted above when I run ng --version again (Angular/Cli is still at version 13.)

In my project I now changed everything in package.json to version 11, then removed the node_modules folder, ran npm install again and ng serve works. But when I run npm run build, it still says:

This version of CLI is only compatible with Angular versions ^13.0.0 || ^13.1.0-next,
but Angular version 11.2.14 was found instead.

my package.json:

"dependencies": {
    "@angular/animations": "~11.0.0",
    "@angular/common": "~11.0.0",
    "@angular/compiler": "~11.0.0",
    "@angular/core": "~11.0.0",
    "@angular/elements": "^11.0.0",
    "@angular/forms": "~11.0.0",
...
}

I know this question has many answers already in this question, but the answers don't work for me: I have Angular/CLi 13 installed, but I need to go back to version 11 for my project:

E_net4
  • 27,810
  • 13
  • 101
  • 139
Boommeister
  • 1,591
  • 2
  • 15
  • 54

2 Answers2

2

You change your global version of Angular CLI. Is your local version (project version) is 11.0? Inside your project folder, Try:

npm uninstall @angular/cli
npm install @angular/cli@11.0.0

There is not -g argument now.

script0
  • 387
  • 2
  • 12
  • I tried, but I still receive the same error. The local version is `Angular CLI: 11.2.15`, but my problem is that I can't change the global version from 13 to 11. The project also doesn't work with cli 13 yet, so I can't update the local version. – Boommeister Dec 14 '21 at 08:40
  • So I have to change the global version, not the locl one. – Boommeister Dec 14 '21 at 08:41
  • Look at it https://stackoverflow.com/questions/39826902/i-want-to-downgrade-angular-cli-globally-as-my-project-is-using-older-version-of – script0 Dec 14 '21 at 08:51
1

npm install --force

It will solve all your issues.