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

我将角度更新到 v9,当我试图回到 v8时,我收到了这个错误。 我已经试过以下方法:

  • 卸载-全局角度/cli
  • 卸载 angle/cli
  • 回到我最后一个包裹 Json
  • 删除节点 _ 模块文件夹
  • 删除回购

继续显示此错误。

我的堆栈痕迹是:

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

角度误差日志:

[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)

版本:

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
80661 次浏览

这似乎是一个问题,与 @angular-devkit/build-angular. 。 试着把它降级到一个特定的版本:

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

正如 Occian Fumnanya Dia 在他上面的回答中所说的那样,我也遇到了同样的问题,并且通过将 @angular-devkit/build-angular.版本降级到 0.803.24来解决了这个问题 如果在降级版本之后仍然得到相同的错误,尝试删除文件夹 platforms并用 ionic cordova run <platform>重新运行。用 androidios代替 <platform>

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

希望能有帮助。

不要删除整个 node _ module 文件夹,只要重命名它并尝试

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

这个命令暂时修正了这种情况:

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

我的 Jenkins 版本要求我运行 Npm 审计修复程序命令来下载 Dependencyes。此命令使同一错误再次出现。 有人知道怎么让审计指令忽略 Angula-devkit 吗?

也运行 npm i @angular-builders/custom-webpack@8.4.1 --save

对我来说,Occian 的回答是不够的,我还必须改变 @angular-builders/custom-webpacklatest8.4.1,因为它有 build-angular的依赖。下面是如何解决这个问题的方法:

Npm list@angle-devkit/build-angle

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

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

如果您使用 npm 审计修复程序,找到您试图修复的包,并将其恢复到稳定版本,并注意漏洞。

根据我的经验,您使用的新模块是为 angular9设计的,您应该升级您的导入,如果可能的话:

 "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",
...
}

就个人而言,最好的解决办法是:

ng update @angular/cli @angular/core

为什么?因为迟早,你需要升级到角9 + 和其他解决方案只是降级。

我今天遇到了同样的问题,直到我使用了这个解决方案,这个方案非常好用。

我打开就修好了

Json 文件

并更新下一行

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

那就跑吧

Npm i

这个 cmd 解决了问题

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

使用下面的版本为目前的角度版本:

@angular-devkit/build-angular@0.8.9 v6-lts

@angular-devkit/build-angular@0.13.10 v7-lts

@angular-devkit/build-angular@0.803.29 v8-lts

@angular-devkit/build-angular@0.901.13 v9-lts

@angular-devkit/build-angular@0.1002.1 v10-lts

参见最新标签版本 @ angle-devkit/build-angle

只需根据您的版本安装@angle-devkit/build-angle 即可 如果你有棱角 V.8然后尝试这个或找到你的版本,并根据你的棱角版本安装它。

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