[英]Ng Build issues when using Angular 10 project - [An unhandled exception occurred: Job name “..getProjectMetadata” does not exist.]
I have an Angular 10 Project which builds successfully locally but fails with the following error when building on jenkins.我有一个 Angular 10 项目,它在本地成功构建,但在 jenkins 上构建时失败并出现以下错误。
[error] Error: Job name "..getProjectMetadata" does not exist.
at Observable._subscribe (/usr/lib/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/experimental/jobs/simple-scheduler.js:350:23)
at Observable._trySubscribe (/usr/lib/node_modules/@angular/cli/node_modules/rxjs/internal/Observable.js:44:25)
at Observable.subscribe (/usr/lib/node_modules/@angular/cli/node_modules/rxjs/internal/Observable.js:30:22)
at /usr/lib/node_modules/@angular/cli/node_modules/rxjs/internal/util/subscribeTo.js:22:31
at Object.subscribeToResult (/usr/lib/node_modules/@angular/cli/node_modules/rxjs/internal/util/subscribeToResult.js:10:45)
at SwitchMapSubscriber._innerSub (/usr/lib/node_modules/@angular/cli/node_modules/rxjs/internal/operators/switchMap.js:65:54)
at SwitchMapSubscriber._next (/usr/lib/node_modules/@angular/cli/node_modules/rxjs/internal/operators/switchMap.js:55:14)
at SwitchMapSubscriber.Subscriber.next (/usr/lib/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:66:18)
at SwitchMapSubscriber.notifyNext (/usr/lib/node_modules/@angular/cli/node_modules/rxjs/internal/operators/switchMap.js:86:26)
at InnerSubscriber._next (/usr/lib/node_modules/@angular/cli/node_modules/rxjs/internal/InnerSubscriber.js:28:21)
at InnerSubscriber.Subscriber.next (/usr/lib/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:66:18)
at /usr/lib/node_modules/@angular/cli/node_modules/rxjs/internal/util/subscribeTo.js:17:28
at Object.subscribeToResult (/usr/lib/node_modules/@angular/cli/node_modules/rxjs/internal/util/subscribeToResult.js:10:45)
at SwitchMapSubscriber._innerSub (/usr/lib/node_modules/@angular/cli/node_modules/rxjs/internal/operators/switchMap.js:65:54)
at SwitchMapSubscriber._next (/usr/lib/node_modules/@angular/cli/node_modules/rxjs/internal/operators/switchMap.js:55:14)
at SwitchMapSubscriber.Subscriber.next (/usr/lib/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:66:18)
Below is the output of the ng --version command from my local machine.下面是来自我本地机器的 ng --version 命令的 output。
Angular CLI: 10.0.2
Node: 10.15.3
OS: win32 x64
Angular: 10.0.3
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.1000.2
@angular-devkit/build-angular 0.1000.2
@angular-devkit/build-optimizer 0.1000.2
@angular-devkit/build-webpack 0.1000.2
@angular-devkit/core 10.0.2
@angular-devkit/schematics 10.0.2
@angular/cdk 10.0.1
@angular/cli 10.0.2
@angular/material 10.0.1
@ngtools/webpack 10.0.2
@schematics/angular 10.0.2
@schematics/update 0.1000.2
rxjs 6.6.0
typescript 3.9.6
webpack 4.43.0
Below is the output on the jenkins server when running the above command.下面是运行上述命令时jenkins服务器上的output。
Angular CLI: 8.3.19
Node: 13.6.0
OS: linux x64
Angular: 10.0.3
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.1000.2
@angular-devkit/build-angular 0.1000.2
@angular-devkit/build-optimizer 0.1000.2
@angular-devkit/build-webpack 0.1000.2
@angular-devkit/core 10.0.2
@angular-devkit/schematics 10.0.2
@angular/cdk 10.0.1
@angular/cli 10.0.2
@angular/material 10.0.1
@ngtools/webpack 10.0.2
@schematics/angular 10.0.2
@schematics/update 0.1000.2
rxjs 6.6.0
typescript 3.9.6
webpack 4.43.0
I have heard that the global angular cli version will not impact things like ng build & other tooling after a new project is generated.我听说在生成新项目后,全局 angular cli 版本不会影响诸如 ng build 和其他工具之类的东西。 Also node version should not cause issues.
节点版本也不应该引起问题。 We have few other Angular v9 projects successfully working with the same jenkins server.
我们很少有其他 Angular v9 项目成功使用相同的 jenkins 服务器。
Any suggestions or anyone else who is facing the same issues.任何建议或面临相同问题的任何其他人。 I would want to solve this & not have to downgrade to version 9.
我想解决这个问题并且不必降级到版本 9。
I had a similar issue to this (wasn't using Jenkins).我有一个类似的问题(没有使用詹金斯)。 The thing that worked for me was downgrading to Node version 12.18.2 on the server.
对我有用的是在服务器上降级到 Node 版本 12.18.2。 Version 13.6.0 caused me problems once I upgraded to angular 10.
升级到 angular 10 后,版本 13.6.0 给我带来了问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.