gpt4 book ai didi

angular - Azure DevOps - Angular 项目构建失败,错误为 : Npm failed with return code: 3

转载 作者:行者123 更新时间:2023-12-03 19:19:57 25 4
gpt4 key购买 nike

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

enter image description here

当我在 azure devops 上构建 Angular 项目时,我收到的错误为

[错误]错误:Npm 失败,返回代码:3

以下是日志文件:-

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! <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="aeddcfc3dec2cbee9e809e809e" rel="noreferrer noopener nofollow">[email protected]</a> 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 <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0a796b677a666f4a3a243a243a" rel="noreferrer noopener nofollow">[email protected]</a> 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\_logs\2020-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\_logs\2020-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\\8.17.0\\x64\\node.exe',
2020-01-03T10:29:10.4549289Z 1 verbose cli 'C:\\hostedtoolcache\\windows\\node\\8.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 <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="89e7f9e4c9bfa7b8baa7bd" rel="noreferrer noopener nofollow">[email protected]</a>
2020-01-03T10:29:10.4549449Z 3 info using <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f19f9e9594b187c9dfc0c6dfc1" rel="noreferrer noopener nofollow">[email protected]</a>
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 <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f380929e839f96b3c3ddc3ddc3" rel="noreferrer noopener nofollow">[email protected]</a>~prebuild-prod: <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a5d6c4c8d5c9c0e5958b958b95" rel="noreferrer noopener nofollow">[email protected]</a>
2020-01-03T10:29:10.4551853Z 6 info lifecycle <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="86f5e7ebf6eae3c6b6a8b6a8b6" rel="noreferrer noopener nofollow">[email protected]</a>~build-prod: <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fd8e9c908d9198bdcdd3cdd3cd" rel="noreferrer noopener nofollow">[email protected]</a>
2020-01-03T10:29:10.4551919Z 7 verbose lifecycle <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fa899b978a969fbacad4cad4ca" rel="noreferrer noopener nofollow">[email protected]</a>~build-prod: unsafe-perm in lifecycle true
2020-01-03T10:29:10.4552353Z 8 verbose lifecycle <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="90e3f1fde0fcf5d0a0bea0bea0" rel="noreferrer noopener nofollow">[email protected]</a>~build-prod: PATH: C:\hostedtoolcache\windows\node\8.17.0\x64\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\a\1\s\node_modules\.bin;C:\hostedtoolcache\windows\node\8.17.0\x64;C:\agents\2.163.1\externals\git\cmd;C:/hostedtoolcache/windows\Python\3.6.8\x64;C:/hostedtoolcache/windows\Python\3.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\1.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\2.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\3.6.8\x64\Scripts;C:\hostedtoolcache\windows\Python\3.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\6\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files (x86)\Windows Kits\10\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 <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d2a1b3bfa2beb792e2fce2fce2" rel="noreferrer noopener nofollow">[email protected]</a>~build-prod: CWD: D:\a\1\s
2020-01-03T10:29:10.4552885Z 10 silly lifecycle <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="5a293b372a363f1a6a746a746a" rel="noreferrer noopener nofollow">[email protected]</a>~build-prod: Args: [ '/d /s /c', 'ng build --prod' ]
2020-01-03T10:29:10.4552932Z 11 silly lifecycle <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9fecfef2eff3fadfafb1afb1af" rel="noreferrer noopener nofollow">[email protected]</a>~build-prod: Returned: code: 3 signal: null
2020-01-03T10:29:10.4552974Z 12 info lifecycle <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4a392b273a262f0a7a647a647a" rel="noreferrer noopener nofollow">[email protected]</a>~build-prod: Failed to exec build-prod script
2020-01-03T10:29:10.4553028Z 13 verbose stack Error: <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3b485a564b575e7b0b150b150b" rel="noreferrer noopener nofollow">[email protected]</a> 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\8.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\8.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 <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1162707c617d7451213f213f21" rel="noreferrer noopener nofollow">[email protected]</a>
2020-01-03T10:29:10.4553940Z 15 verbose cwd D:\a\1\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\\8.17.0\\x64\\node.exe" "C:\\hostedtoolcache\\windows\\node\\8.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 <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9eedfff3eef2fbdeaeb0aeb0ae" rel="noreferrer noopener nofollow">[email protected]</a> 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 <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="88fbe9e5f8e4edc8b8a6b8a6b8" rel="noreferrer noopener nofollow">[email protected]</a> 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

任何帮助将不胜感激。

最佳答案

如果要构建 Angular 7.3 到 Angular 8 更高版本的项目,则至少需要 Node 10.15.3 到 Node 12.x。

关于angular - Azure DevOps - Angular 项目构建失败,错误为 : Npm failed with return code: 3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59577359/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com