Azure DevOps – Angular项目构建失败,错误信息为:Npm 失败,返回代码:3。

huangapple go评论80阅读模式
英文:

Azure DevOps - Angular project build failing with error: Npm failed with return code: 3

问题

我正在使用Azure CI进行Angular项目。我已经配置了构建如下。

当我在Azure DevOps上构建Angular项目时,我遇到了以下错误:

[error]Error: Npm failed with return code: 3

以下是日志文件:

英文:

I am using Azure CI for angular project. I have configure the build like below.

Azure DevOps – Angular项目构建失败,错误信息为:Npm 失败,返回代码:3。

When I build the angular project on azure devops, I am getting the error as

[error]Error: Npm failed with return code: 3

Below is log file:-

2020-01-03T10:29:10.3975975Z npm ERR! code ELIFECYCLE
2020-01-03T10:29:10.3976115Z npm ERR! errno 3
2020-01-03T10:29:10.3976255Z npm ERR! sample@0.0.0 build-prod: `ng build --prod`
2020-01-03T10:29:10.3976408Z npm ERR! Exit status 3
2020-01-03T10:29:10.3976545Z npm ERR! 
2020-01-03T10:29:10.3976685Z npm ERR! Failed at the sample@0.0.0 build-prod script.
2020-01-03T10:29:10.3976861Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-01-03T10:29:10.3976986Z 
2020-01-03T10:29:10.3977126Z npm ERR! A complete log of this run can be found in:
2020-01-03T10:29:10.3977267Z npm ERR!     C:\npm\cache\_logs20-01-03T10_29_10_346Z-debug.log
2020-01-03T10:29:10.4549103Z Found npm debug log, make sure the path matches with the one in npm's output: C:\npm\cache\_logs20-01-03T10_29_10_346Z-debug.log
2020-01-03T10:29:10.4549198Z 0 info it worked if it ends with ok
2020-01-03T10:29:10.4549244Z 1 verbose cli [ 'C:\\hostedtoolcache\\windows\\node\.17.0\\x64\\node.exe',
2020-01-03T10:29:10.4549289Z 1 verbose cli   'C:\\hostedtoolcache\\windows\\node\.17.0\\x64\\node_modules\\npm\\bin\\npm-cli.js',
2020-01-03T10:29:10.4549335Z 1 verbose cli   'run-script',
2020-01-03T10:29:10.4549373Z 1 verbose cli   'build-prod' ]
2020-01-03T10:29:10.4549409Z 2 info using npm@6.13.4
2020-01-03T10:29:10.4549449Z 3 info using node@v8.17.0
2020-01-03T10:29:10.4551771Z 4 verbose run-script [ 'prebuild-prod', 'build-prod', 'postbuild-prod' ]
2020-01-03T10:29:10.4551813Z 5 info lifecycle sample@0.0.0~prebuild-prod: sample@0.0.0
2020-01-03T10:29:10.4551853Z 6 info lifecycle sample@0.0.0~build-prod: sample@0.0.0
2020-01-03T10:29:10.4551919Z 7 verbose lifecycle sample@0.0.0~build-prod: unsafe-perm in lifecycle true
2020-01-03T10:29:10.4552353Z 8 verbose lifecycle sample@0.0.0~build-prod: PATH: C:\hostedtoolcache\windows\node.17.0\x64\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\a\s\node_modules\.bin;C:\hostedtoolcache\windows\node.17.0\x64;C:\agents.163.1\externals\git\cmd;C:/hostedtoolcache/windows\Python.6.8\x64;C:/hostedtoolcache/windows\Python.6.8\x64\Scripts;C:\Program Files\Mercurial\;C:\ProgramData\kind;C:\vcpkg;C:\cf-cli;C:\Program Files (x86)\NSIS\;C:\Program Files\Mercurial\;C:\Program Files\Boost.69.0;C:\Program Files\dotnet;C:\mysql-5.7.21-winx64\bin;C:\Program Files\Java\zulu-8-azure-jdk_8.40.0.25-8.0.222-win_x64\bin;C:\npm\prefix;C:\Program Files (x86)\sbt\bin;C:\Rust\.cargo\bin;C:\hostedtoolcache\windows\Ruby.5.5\x64\bin;C:\Go1.12.7\bin;C:\Program Files\Git\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\hostedtoolcache\windows\Python.6.8\x64\Scripts;C:\hostedtoolcache\windows\Python.6.8\x64;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin;C:\Program Files\Microsoft MPI\Bin\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\Chocolatey\bin;C:\Program Files\Docker;C:\Program Files\PowerShell\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server0\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server0\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server0\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server0\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server0\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server0\DTS\Binn\;C:\Program Files (x86)\Windows Kits\Windows Performance Toolkit\;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;c:\tools\php;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\Subversion\bin;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.6.2\bin;C:\Program Files\CMake\bin;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Program Files\OpenSSL\bin;C:\Users\VssAdministrator\.dotnet\tools;C:\Program Files
2020-01-03T10:29:10.4552833Z 9 verbose lifecycle sample@0.0.0~build-prod: CWD: D:\a\s
2020-01-03T10:29:10.4552885Z 10 silly lifecycle sample@0.0.0~build-prod: Args: [ '/d /s /c', 'ng build --prod' ]
2020-01-03T10:29:10.4552932Z 11 silly lifecycle sample@0.0.0~build-prod: Returned: code: 3  signal: null
2020-01-03T10:29:10.4552974Z 12 info lifecycle sample@0.0.0~build-prod: Failed to exec build-prod script
2020-01-03T10:29:10.4553028Z 13 verbose stack Error: sample@0.0.0 build-prod: `ng build --prod`
2020-01-03T10:29:10.4553066Z 13 verbose stack Exit status 3
2020-01-03T10:29:10.4553110Z 13 verbose stack     at EventEmitter.<anonymous> (C:\hostedtoolcache\windows\node.17.0\x64\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
2020-01-03T10:29:10.4553166Z 13 verbose stack     at emitTwo (events.js:126:13)
2020-01-03T10:29:10.4553206Z 13 verbose stack     at EventEmitter.emit (events.js:214:7)
2020-01-03T10:29:10.4553253Z 13 verbose stack     at ChildProcess.<anonymous> (C:\hostedtoolcache\windows\node.17.0\x64\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
2020-01-03T10:29:10.4553301Z 13 verbose stack     at emitTwo (events.js:126:13)
2020-01-03T10:29:10.4553340Z 13 verbose stack     at ChildProcess.emit (events.js:214:7)
2020-01-03T10:29:10.4553380Z 13 verbose stack     at maybeClose (internal/child_process.js:915:16)
2020-01-03T10:29:10.4553431Z 13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
2020-01-03T10:29:10.4553903Z 14 verbose pkgid sample@0.0.0
2020-01-03T10:29:10.4553940Z 15 verbose cwd D:\a\s
2020-01-03T10:29:10.4553978Z 16 verbose Windows_NT 10.0.14393
2020-01-03T10:29:10.4554045Z 17 verbose argv "C:\\hostedtoolcache\\windows\\node\.17.0\\x64\\node.exe" "C:\\hostedtoolcache\\windows\\node\.17.0\\x64\\node_modules\\npm\\bin\\npm-cli.js" "run-script" "build-prod"
2020-01-03T10:29:10.4554083Z 18 verbose node v8.17.0
2020-01-03T10:29:10.4554119Z 19 verbose npm  v6.13.4
2020-01-03T10:29:10.4554160Z 20 error code ELIFECYCLE
2020-01-03T10:29:10.4554195Z 21 error errno 3
2020-01-03T10:29:10.4554233Z 22 error sample@0.0.0 build-prod: `ng build --prod`
2020-01-03T10:29:10.4554270Z 22 error Exit status 3
2020-01-03T10:29:10.4554315Z 23 error Failed at the sample@0.0.0 build-prod script.
2020-01-03T10:29:10.4554357Z 23 error This is probably not a problem with npm. There is likely additional logging output above.
2020-01-03T10:29:10.4554403Z 24 verbose exit [ 3, true ]
2020-01-03T10:29:10.4554428Z 
2020-01-03T10:29:10.4624480Z ##[error]Error: Npm failed with return code: 3
2020-01-03T10:29:10.4648969Z ##[section]Finishing: Build the project

Any help will be appreciated.

答案1

得分: 4

如果您想构建 Angular 7.3 到后续的 Angular 8 项目,您需要至少使用 Node 10.15.3 到 Node 12.x。

英文:

If you want to build Angular 7.3 to Angular 8 later project, you need at least Node 10.15.3 to Node 12.x.

huangapple
  • 本文由 发表于 2020年1月3日 18:59:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/59577359.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定