152

I updated my angular to v9 and when I try to go back in v8, I receive this error. I have already tried the following:

  • uninstall -global angular/cli
  • uninstall angular/cli
  • go back to my last package.json
  • delete node_module folder
  • delete repo

This error continues to show.

My stacktrace is :

An unhandled exception occurred: Job name "..getProjectMetadata" does not exist.
See angular-errors.log for further details.

angular-errors.log :

[error] Error: Job name "..getProjectMetadata" does not exist.
    at Observable._subscribe (/Front/node_modules/@angular-devkit/core/src/experimental/jobs/simple-scheduler.js:350:23)
    at Observable._trySubscribe (/Front/node_modules/@angular-devkit/core/node_modules/rxjs/internal/Observable.js:44:25)
    at Observable.subscribe (/Front/node_modules/@angular-devkit/core/node_modules/rxjs/internal/Observable.js:30:22)
    at /Front/node_modules/@angular-devkit/core/node_modules/rxjs/internal/util/subscribeTo.js:22:31
    at Object.subscribeToResult (/Front/node_modules/@angular-devkit/core/node_modules/rxjs/internal/util/subscribeToResult.js:10:45)
    at SwitchMapSubscriber._innerSub (/Front/node_modules/@angular-devkit/core/node_modules/rxjs/internal/operators/switchMap.js:65:54)
    at SwitchMapSubscriber._next (/Front/node_modules/@angular-devkit/core/node_modules/rxjs/internal/operators/switchMap.js:55:14)
    at SwitchMapSubscriber.Subscriber.next (/Front/node_modules/@angular-devkit/core/node_modules/rxjs/internal/Subscriber.js:66:18)
    at SwitchMapSubscriber.notifyNext (/Front/node_modules/@angular-devkit/core/node_modules/rxjs/internal/operators/switchMap.js:86:26)
    at InnerSubscriber._next (/Front/node_modules/@angular-devkit/core/node_modules/rxjs/internal/InnerSubscriber.js:28:21)
    at InnerSubscriber.Subscriber.next (/Front/node_modules/@angular-devkit/core/node_modules/rxjs/internal/Subscriber.js:66:18)
    at /Front/node_modules/@angular-devkit/core/node_modules/rxjs/internal/util/subscribeTo.js:17:28
    at Object.subscribeToResult (/Front/node_modules/@angular-devkit/core/node_modules/rxjs/internal/util/subscribeToResult.js:10:45)
    at SwitchMapSubscriber._innerSub (/Front/node_modules/@angular-devkit/core/node_modules/rxjs/internal/operators/switchMap.js:65:54)
    at SwitchMapSubscriber._next (/Front/node_modules/@angular-devkit/core/node_modules/rxjs/internal/operators/switchMap.js:55:14)
    at SwitchMapSubscriber.Subscriber.next (/Front/node_modules/@angular-devkit/core/node_modules/rxjs/internal/Subscriber.js:66:18)

ng --version :

Angular CLI: 8.3.18
Node: 12.15.0
OS: darwin x64
Angular: 8.2.13
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.803.18
@angular-devkit/build-angular     0.900.1
@angular-devkit/build-optimizer   0.900.1
@angular-devkit/build-webpack     0.900.1
@angular-devkit/core              8.3.18
@angular-devkit/schematics        8.3.18
@angular/cdk                      8.2.3
@angular/cli                      8.3.18
@angular/material                 8.2.3
@ngtools/webpack                  9.0.1
@schematics/angular               8.3.18
@schematics/update                0.803.18
rxjs                              6.5.3
typescript                        3.5.3
webpack                           4.41.2
2
  • 6
    I got this error after running npm audit fix. Although I lock dependencies it still upgraded to angular 9 which I don't want. As always with Angular major releases, very inconvenient and a hassle upgrading. I would advise to stay on Angular 8 if not strictly necessary, a lot of dependencies are not yet updated to the latest version and will cause a lot of errors. Feb 17, 2020 at 16:19
  • 1
    I did revert the changes after npm audit fix, then npm i && npm update && npm audit fix && npm audit fix. So basically did first an update and THEN audit fix. Worked for me.
    – doptrois
    Sep 29, 2020 at 16:41

12 Answers 12

392

It seems to be an issue with @angular-devkit/build-angular.. Try downgrading it to a specific version:

npm i @angular-devkit/[email protected]
13
  • 2
    @AtifMajeed you should use version 0.803.24, not 0.900.4
    – Ben
    Mar 5, 2020 at 7:35
  • 7
    Worked for me but I don't understand why, I didn't update angular. I did npm audit fix Mar 5, 2020 at 16:24
  • 19
    I also started getting this error after npm audit fix today. Basically what I understood about npm audit fix is that it automatically detect all vulnerable packages and upgrade with fixed versions if available. But it is not supposed to do any breaking upgrade like this automatically. So there must be some mistake from the side of that package maintainer too, that caused npm audit to be unaware of the breaking change.
    – rineez
    Mar 26, 2020 at 6:27
  • 1
    Latest version is npm install @angular-devkit/[email protected] Link npmjs.com/package/@angular-devkit/build-angular/v/0.803.26
    – aunlead
    Apr 7, 2020 at 8:00
  • 1
    There's going to be a lot of projects out there using exactly @angular-devkit/[email protected] now! XD Apr 15, 2020 at 2:07
19

Run also npm i @angular-builders/[email protected] --save

For me Occian's answer was not enough, I also had to change @angular-builders/custom-webpack from latest to 8.4.1, because it had build-angular dependency too. This is how to figure it out:

npm list @angular-devkit/build-angular

[email protected] C:\projects\2778\reports-web-client
+-- @angular-builders/[email protected]
| `-- @angular-devkit/[email protected]
`-- @angular-devkit/[email protected]

Which meant, I had 2 versions of the package, and that's why the error would still show up.

1
  • this solution worked and completely solved my issue. however, it leaded me to consider the use of npm-force-resolutions. with this tool, we don't need to be annoyed with such multiple versions. we can solve it by just having "resolutions": { "@angular-devkit/build-angular": "0.803.8" } in package.json instead. it can protect this specific version from npm audit fix as well.
    – Yas Ikeda
    Nov 26, 2020 at 16:26
10

Personally, the best solution is:

ng update @angular/cli @angular/core

Why? Because sooner or later, you need to upgrade to Angular 9+ and the other solutions are only to downgrade it.

I was facing the same issue today until I used this solution and this one works perfectly well.

6

Use below version for current angular version:

@angular-devkit/[email protected] v6-lts

@angular-devkit/[email protected] v7-lts

@angular-devkit/[email protected] v8-lts

@angular-devkit/[email protected] v9-lts

@angular-devkit/[email protected] v10-lts

see last current tags version @angular-devkit/build-angular

5

This command fixes the situation temporarily:

npm i @angular-devkit/[email protected]

My Jenkins build requires me to run the npm audit fix command to download dependencyes. This command makes the same error appear again. Anyone have any idea how to make the audit command ignore angula-devkit?

0
5

If you use npm audit fix, find the package which you tried to fix and restore to a stable version and be aware with vulnerabilities.

3

i fixed it by open

package.json file

and update on the next line

@angular-devkit/build-angular": "^0.803.8"

then run

npm i

2

I had the same issue and solved it by downgrading @angular-devkit/build-angular. version to 0.803.24 as Occian Fumnanya Dia said in his answer above If after downgrading the version you still get the same error, try deleting the folder platforms and re-run with ionic cordova run <platform>. Replace <platform> with android or ios.

It will recreate the folder plaforms with new things.

Hope it helps.

2

This cmd fixes the problems

npm i @angular-devkit/[email protected]
1

Instead of deleting the whole node_modules folders, just rename it and try

npm install 
sudo npm install --unsafe-perm //for macOS

Please find below my angular packages versions -

"@angular-devkit/build-angular": "0.802.0",
"@angular-devkit/core": "8.2.0",
"@angular/animations": "8.2.0",
"@angular/cli": "8.2.0",
"@angular/common": "8.2.0",
"@angular/compiler": "8.2.0",
"@angular/compiler-cli": "8.2.0",
"@angular/core": "8.2.0",
1
  • Actually deleting the whole node_modules fixed my issue. I had tried other methods suggested in this thread and I still had the error.
    – Louis
    Dec 21, 2020 at 3:49
0

From my experience a new module that you are using is designed for angular9 and you should upgrade your imports if possible to:

 "dependencies": {
    "@angular/animations": "^9.1.9",
    "@angular/cdk": "^9.2.4",
    "@angular/common": "^9.1.9",
    "@angular/compiler": "^9.1.9",
    "@angular/core": "^9.1.9",
    "@angular/forms": "^9.1.9",
    "@angular/platform-browser": "^9.1.9",
    "@angular/platform-browser-dynamic": "^9.1.9",
    "@angular/router": "^9.1.9",
 ...
}
"devDependencies": {
    "@angular-devkit/build-angular": "^0.901.7",
    "@angular/cli": "^9.1.7",
    "@angular/compiler-cli": "^9.1.9",
    "@angular/language-service": "^9.1.9",
   ...
}
0

Just install the @angular-devkit/build-angular according to your version like if you have angular V.8 then try this or find your version and install it according to your angular version.

npm i @angular-devkit/[email protected]

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.