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/[email protected] 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:

2 Answers 2

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/[email protected]

There is not -g argument now.

Sign up to request clarification or add additional context in comments.

3 Comments

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.
So I have to change the global version, not the locl one.
1

npm install --force

It will solve all your issues.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.