作业名称“ ..getProjectMetadata”不存在


63

我将我的角度更新为v9,当我尝试在v8中返回时,收到此错误。我已经尝试了以下方法:

  • 卸载-global angular / cli
  • 卸载angular / cli
  • 回到我的最后一个package.json
  • 删除node_module文件夹
  • 删除仓库

该错误继续显示。

我的堆栈跟踪是:

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
运行后出现此错误npm audit fix。尽管我锁定了依赖项,但仍将其升级为我不想要的角度9。与Angular主要版本一样,非常不方便且升级麻烦。如果不是绝对必要,我建议您使用Angular 8,因为很多依赖项尚未更新到最新版本,并且会导致很多错误。
米开朗基罗

Answers:


186

@angular-devkit/build-angular.. 似乎有问题。请尝试将其降级为特定版本:

npm i @angular-devkit/build-angular@0.803.24

5
完美的答案!
Lathy

3
你救了我的一天!
zs2020

2
@AtifMajeed,您应该使用0.803.24版本,而不是0.900.4
Ben

1
为我工作,但我不明白为什么,我没有更新角度。我做了npm audit fix
赫尔曼·阿科斯塔

1
npm audit fix今天开始,我也开始收到此错误。基本上,我了解的npm audit fix是它会自动检测所有易受攻击的软件包,并在可用的情况下以固定版本进行升级。但这不应该自动进行任何重大的升级。因此,该软件包维护人员也一定存在一些错误,该错误导致npm审核不了解重大更改。
内斯

2

我遇到了同样的问题,并通过将@angular-devkit/build-angular.版本降级0.803.24为Occian Fumnanya Dia在上面回答中所说的解决了该问题。 如果在降级该版本后仍然出现相同的错误,请尝试删除该文件夹platforms并重新运行ionic cordova run <platform>。替换<platform>androidios

它将重新创建文件夹 plaforms使用新内容。

希望能帮助到你。


0

与其删除整个node_modules文件夹,不如将其重命名并尝试

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

请在下面找到我的角度包版本-

"@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",

0

此命令可暂时解决此问题:

npm i @angular-devkit/build-angular@0.803.24

我的Jenkins构建要求我运行npm audit fix命令来下载依赖项。此命令使相同的错误再次出现。有谁知道如何使audit命令忽略angula-devkit?


也许,加入--save到命令应该修复它..
阿绍特

0

还跑 npm i @angular-builders/custom-webpack@8.4.1 --save

对我来说Occian的回答是不够的,我也不得不改变@angular-builders/custom-webpack来自latest8.4.1,因为它有build-angular依赖性了。这是解决方法:

npm列表@ angular-devkit / build-angular

reports-web-client@0.0.0 C:\projects\2778\reports-web-client
+-- @angular-builders/custom-webpack@9.1.0
| `-- @angular-devkit/build-angular@0.901.1
`-- @angular-devkit/build-angular@0.803.8

这意味着,我有2个版本的软件包,这就是为什么错误仍然会出现的原因。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.