An unhandled exception occurred: Job name "..getProjectMetadata" does not exist

106,165

Solution 1

It seems to be a problem with @angular-devkit/build-angular.

Try updating it by running

npm i @angular-devkit/build-angular

Or downgrading it by specifying a previous version, such as

npm i @angular-devkit/[email protected]

Solution 2

I had this error after npm audit found vulnerabilities in the version of @angular-devkit/build-angular that I was using. I ran npm audit fix which updated it to 0.900.2, but when I ran ng serve it gave the error quoted in the question.

I resolved it by downgrading to version 0.803.25. This was the highest version I could find which did not cause any errors when running ng serve. The vulnerabilities found by npm audit are resolved in this version.

This is the command I ran:

npm i @angular-devkit/[email protected]

Solution 3

I had just created a new project and got this error. Since I had no legacy code I needed to work with and wanted to use the latest (9.0) version of Angular, I ran this command:

ng update @angular/cli @angular/core

and it fixed everything.

Solution 4

update @angular-devkit/build-angular version .

Solution 5

I had the same issue in Ionic 4 after running "npm audit fix", but npm broke the whole versioning of the dependencies.

I tried doing most of the things listed here but it would fix one problem and create a new one. So the only solution that worked for me was manual dependency handling.

Check out what versions of each package you need in your package.json and package-lock.json (which package version do other packages depend on and expect to find in your project, mine were expecting about three total versions of some files), some will be shown as warnings in your cli after npm installing some packages, but not all will show so do best to manually check.
NB: I found package-lock.json easier for me to read but I would refer to package.json to make sure I was still on the right track.

For me the main package was Ionic itself (@ionic/angular-toolkit was the only package I could find that was connected to angular), so I looked at the version of angular it was expecting and downgraded to that. Then every other package that angular needed also had to be checked. It was a lot of work and spent half a day fixing but it solved all my issues.

  1. An ionic package had this dependencies;
    • @schematics/angular@^8.0.0
    • tslib@^1.9.0
    • ws@^7.0.1

Focusing on the angular package, I decided to
npm install @schematics/[email protected]

  1. That dependency, @schematics/[email protected], had the following dependencies;

  2. The dependency, @angular-devkit/[email protected] had the dependencies;

I did this for all the packages until I could build my app again. But you can just install in one go if you know the versions they require
npm install @schematics/[email protected] @angular-devkit/[email protected] @angular-devkit/[email protected]

You can put all the packages in that npm install line if you already know for certain which other packages should be downgraded or upgraded to save time.

Hope this helps anyone who couldn't find a solution from the other comments.

Share:
106,165

Related videos on Youtube

vasil001
Author by

vasil001

Updated on April 19, 2021

Comments

  • vasil001
    vasil001 about 3 years

    When I start to run my Application, I get this error:

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

    I have these versions: Angular CLI: 8.3.19, Node: 12.14.0.

    Any Idea what causes this problem?

  • João Paiva
    João Paiva over 4 years
    Updating the version didn't work for me, but downgrading to that specific one did it for me.
  • Vikas Kandari
    Vikas Kandari over 4 years
    worked for me i checked package.json in my github and upgraded to following version npm i @angular-devkit/build-angular@~0.803.17 and it perfectly worked for me
  • Snowman
    Snowman about 4 years
    Should be the accepted answer since it addresses the most common use case of getting this error.
  • Captain Fantastic
    Captain Fantastic about 4 years
    for ionic 5 trying to add leaflet maps, build-angular in package.json was showing 0.900.1; that was causing the problem; downgrading to the other packages at 0.801.12 brought the high vulnerabilities back; downgrading to 0.803.24 worked.. no more vulnerabilities but was still working as ionic 5 shows won't work with 9.0 angular
  • BIJAY
    BIJAY about 4 years
    This issue usually comes when we are installing an angular theme. For me, downgrading the version worked.
  • Liquid Core
    Liquid Core about 4 years
    How this should be even useful? How one determines to which version downgrade??? LOL
  • Mohsen
    Mohsen about 4 years
    For me, downgrading to 0.801.2 worked (i.e., npm i @angular-devkit/[email protected]). Thank you.
  • Harinath
    Harinath about 4 years
    Try ng update @angular/cli @angular/core (answered by @ColemanTO) It will update the angular project and fix this error
  • severin.julien
    severin.julien almost 4 years
    You shouldn't do that, you should use ng update for migration
  • Lonely
    Lonely almost 4 years
    It can happen if you use npm audit fix --force. The following message speaks for itself: npm WARN using --force I sure hope you know what you are doing.
  • King
    King almost 4 years
    Also work for me after downgrading to a lower version of angular
  • Nisanur
    Nisanur almost 4 years
    "npm i @angular-devkit/[email protected]" it worked for me thanks.
  • Naga
    Naga almost 4 years
    Happened to me as well, needs more careful while running audit fix which actually breaks annoying though
  • Casey Hungler
    Casey Hungler over 3 years
    Since everyone is mentioning specific versions that work for them, it might be helpful to point out that the library has tags that point to the latest supported version for your CLI version. If you are using Angular 8, you can upgrade to the latest compatible version with npm i @angular-devkit/build-angular@v8-lts, which is more likely to work than whatever version was latest a few months ago. See the "versions" tab at npmjs.com/package/@angular-devkit/build-angular, but you can probably guess what tag is appropriate for your version.
  • Hidayt Rahman
    Hidayt Rahman over 3 years
    I broke it two times with npm audit now I am ok with vulerabilities
  • Ultan Kearns
    Ultan Kearns about 3 years
    Thanks so much "npm i @angular-devkit/[email protected]" worked for me.