Job name "..getProjectMetadata" does not exist
Asked Answered
M

12

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
Mayes answered 11/2, 2020 at 17:35 Comment(2)
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.Studdard
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.Seow
P
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]
Pigmy answered 11/2, 2020 at 19:12 Comment(13)
Fixed it for me- I'm on Angular 8.0.0Palm
this answer did't work for me. I still see same error after running 'npm i @angular-devkit/[email protected]'Sustentacular
@AtifMajeed you should use version 0.803.24, not 0.900.4Pneumonic
Worked for me but I don't understand why, I didn't update angular. I did npm audit fixTheorbo
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.Oliviero
Latest version is npm install @angular-devkit/[email protected] Link npmjs.com/package/@angular-devkit/build-angular/v/0.803.26Freesia
There's going to be a lot of projects out there using exactly @angular-devkit/[email protected] now! XDInterjection
When I Did like this I lost some specific installed packagesOconner
As @Freesia wrote, check the version first. If you are getting a warning like Your global Angular CLI version (9.1.8) is greater than your local version (8.3.26). The local Angular CLI version is used. from the command ng serve then the project you've loaded is older than your global version. Translate the local version number (here 8.3.26) into 0.803.36 and then run it with that version number (here npm install @angular-devkit/[email protected]).Ideational
npm audit fix and/or other packages could cause you to get/have different version of @angular-devkit/build-angular (refer Ashot's answer as well). Beside this solution, consider to use npm-force-resolutions. It can solve such issues.Apul
Most probably because @angular-devkit/build-angular only updates the minor version and not the major version. That would be why npm audit thinks its fine to just update.Edacity
I am facing the same issue and above solution is not working for me. I tried upgrading and downgrading but no luck. Any helping hand please :(Waynant
Hi @AjeetMalviya, you can check my answer below. This one is outdated.Georgiegeorgina
E
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.

Etka answered 20/4, 2020 at 10:52 Comment(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.Apul
G
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.

Georgiegeorgina answered 12/6, 2020 at 18:42 Comment(0)
M
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

Mcgary answered 25/12, 2020 at 9:11 Comment(0)
S
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?

Sclerosed answered 31/3, 2020 at 8:4 Comment(0)
I
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.

Impugn answered 26/5, 2020 at 3:37 Comment(0)
O
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

Optimism answered 28/6, 2020 at 12:58 Comment(0)
S
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.

Stucco answered 12/3, 2020 at 11:15 Comment(0)
C
2

This cmd fixes the problems

npm i @angular-devkit/[email protected]
Curculio answered 29/8, 2020 at 16:1 Comment(0)
W
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",
Wisnicki answered 19/3, 2020 at 5:40 Comment(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.Magnetoelectricity
P
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",
   ...
}
Pianism answered 28/5, 2020 at 22:19 Comment(0)
U
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]
Undergrowth answered 7/5, 2021 at 7:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.