angular-cli: ng update to v8 causes [error] Error: Job name "..getProjectMetadata" does not exist.

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Description

A clear and concise description of the problem...

When I run ng update @angular/cli@8 @angular/core@8, I then get an error when I run ng build

[error] Error: Job name "..getProjectMetadata" does not exist.

Details are also here https://stackoverflow.com/questions/59447679/an-unhandled-exception-occurred-job-name-getprojectmetadata-does-not-exist

I resolved this by running npm i @angular-devkit/build-angular@0.803.24

I expected that updating to v8 would resolve this.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 25
  • Comments: 24 (2 by maintainers)

Commits related to this issue

Most upvoted comments

Same here!

after and “npm audit fix” I got the same error. After a check I have seen: “@angular-devkit/build-angular”: “^0.900.3”,

Downgrade to: “@angular-devkit/build-angular”: “~0.803.24”,

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Description

A clear and concise description of the problem… When I run ng update @angular/cli@8 @angular/core@8, I then get an error when I run ng build

[error] Error: Job name "..getProjectMetadata" does not exist.

Details are also here https://stackoverflow.com/questions/59447679/an-unhandled-exception-occurred-job-name-getprojectmetadata-does-not-exist

I resolved this by running npm i @angular-devkit/build-angular@0.803.24

I expected that updating to v8 would resolve this.

you can try version 0.803.8, the version before the one you post (in Angular 9)

had the same issue from accidentally installing latest version of custom-webpack my fix was to downgrade “@angular-builders/custom-webpack”: “9.0.0” to “@angular-builders/custom-webpack”: “^8.4.1”,

In my case, the version of my Angular is still Angular 8, but somehow it still thinks that I’m using Angular 9, so the @angular-devkit/build-angular version in package.json became ^0.900.1, which seems not suitable for Angular 8. So what worked for me was downgrading this dependency to the fixed version that I’ve used before (0.803.8)

I was receiving the same error. Downgrading to “@angular-devkit/build-angular”: “~0.803.24”, fixed the issue for me.

Another +1 from me on downgrading the build-angular package to ~0.803.24. Had to do so after creating a new Angular SPA project from Visual Studio 2019. After running npm audit fix (because out-of-the-box the project template has a ton of vulnerabilities), I encountered this issue.

Also I feel a little silly admitting this, but make sure that, after you downgrade said package, you run npm install again! Otherwise you’ll still be building with the version that causes the error. (I downgraded by changing the json file and was still getting errors since I immediately ran ng build. I assume if you downgrade using npm instead of just changing the file, you don’t have to take this extra step manually.)

Same here! If your app was working and then one of a sudden it start crashing, it’s probably because of the almighty “npm audit fix” which is supposed to save our lives.

So In my case, I noticed this in my package.json@angular-devkit/build-angular”: “^0.901.3”,

So I Downgraded to: “@angular-devkit/build-angular”: “~0.803.2”,

and then finally I npm i. Don’t forget to reinstall the dependencies in your package.json after you manually update them. it will save you couple hours

For newbies (Like me): Go to package.,json find and change to “@angular-devkit/build-angular”: “~0.803” then run npm i.

When a semantic version’s major is a zero than the minor version is treated as a major and the carat (^) and tilde (~) are equivalent. (https://github.com/npm/node-semver#caret-ranges-123-025-004)

If npm audit fix is not respecting that then it most likely has a defect. There appears to be an open issue on npm’s project regarding a different dependency with a similar situation: https://github.com/npm/cli/issues/726

Executing npm i @angular-devkit/build-angular@^0.803.24 will install 0.803.25 so this appears isolated to npm audit fix.

@rineez-livares Yep, it’s normal if you prefix the package version with ^.

This allows audit to update to the highest minor version it finds. What’s not normal is that @angular-devkit/build-angular uses minors to differentiate between builders for majors of angular. The solution is to use ~ prefix for @angular-devkit/build-angular , like this:

"@angular-devkit/build-angular": "~0.803", 

Now npm audit fix won’t upgrade it to 0.90x... anymore. But will upgrade it to latest in 0.803.* range, so you get any patches aimed at v8 builder.

Same goes for @angular/pwa, if anyone uses it.