簡體   English   中英

Azure Pipelines 中的 NG 構建失敗,出現 NPM 錯誤 134

[英]NG Build fails in Azure Pipelines with NPM error 134

大約 50% 的托管構建失敗並顯示 npm 錯誤 134。我正在使用托管 vs2017 構建具有相同構建定義的相同提交。 我正在使用 Angular CLI 構建一個 Angular 應用程序。 npm 任務調用“run build”,它在我的 package.json 中定義為“ng build --prod”。 成功的構建和失敗的構建都使用 npm 任務版本 1.1.49 和 npm 版本 6.8。 這讓我相信它與托管環境有關。 托管的 vs2017 和 vs2019 代理幾乎總是失敗。 Windows 容器代理失敗的概率約為 50%。

npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! my-app@1.0.0 build: `ng build --prod`
npm ERR! Exit status 134
npm ERR! 
npm ERR! Failed at the my-app@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\npm\cache\_logs\TimeStampHere-debug.log
Found npm debug log, make sure the path matches with the one in npm's output: C:\npm\cache\_logs\TimeStampHere-debug.log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\npm\\prefix\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'build' ]
2 info using npm@6.8.0
3 info using node@v10.15.2
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle my-app@1.0.0~prebuild: my-app@1.0.0
6 info lifecycle my-app@1.0.0~build: my-app@1.0.0
7 verbose lifecycle my-app@1.0.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle my-app@1.0.0~build: PATH: C:\npm\prefix\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;d:\a\1\s\ngmyapp\node_modules\.bin;C:\agents\2.149.2\externals\git\cmd;C:/hostedtoolcache/windows/Python/3.6.8/x64;C:/hostedtoolcache/windows/Python/3.6.8/x64/Scripts;C:\vcpkg;C:\cf-cli;C:\Program Files (x86)\NSIS\;C:\Program Files\Boost\1.69.0;C:\Users\VssAdministrator\.dotnet\tools;C:\Program Files\dotnet;C:\mysql-5.7.21-winx64\bin;C:\Program Files\Java\zulu-8-azure-jdk_8.36.0.1-8.0.202-win_x64\bin;C:\npm\prefix;C:\hostedtoolcache\windows\Ruby\2.5.0\x64\bin;C:\Go1.11.5\bin;C:\Program Files\Git\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\Scripts;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64;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)\Subversion\bin;C:\Program Files\nodejs\;C:\Program Files\CMake\bin;C:\Program Files\Mercurial;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Program Files\OpenSSL\bin;C:\Users\VssAdministrator\AppData\Local\Microsoft\WindowsApps;
9 verbose lifecycle my-app@1.0.0~build: CWD: d:\a\1\s\ngmyapp
10 silly lifecycle my-app@1.0.0~build: Args: [ '/d /s /c', 'ng build --prod' ]
11 silly lifecycle my-app@1.0.0~build: Returned: code: 134  signal: null
12 info lifecycle my-app@1.0.0~build: Failed to exec build script
13 verbose stack Error: my-app@1.0.0 build: `ng build --prod`
13 verbose stack Exit status 134
13 verbose stack     at EventEmitter.<anonymous> (C:\npm\prefix\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:189:13)
13 verbose stack     at ChildProcess.<anonymous> (C:\npm\prefix\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:189:13)
13 verbose stack     at maybeClose (internal/child_process.js:970:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid my-app@1.0.0
15 verbose cwd d:\a\1\s\myapp
16 verbose Windows_NT 10.0.14393
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\npm\\prefix\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
18 verbose node v10.15.2
19 verbose npm  v6.8.0
20 error code ELIFECYCLE
21 error errno 134
22 error my-app@1.0.0 build: `ng build --prod`
22 error Exit status 134
23 error Failed at the my-app@1.0.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 134, true ]

##[error]Error: Npm failed with return code: 134
##[section]Finishing: npm build

編輯:我已經在內部配置了一個構建代理,我沒有遇到這個問題。

大約 50% 的托管構建失敗,出現 npm 錯誤 134。我正在使用托管 vs2017 構建具有相同構建定義的相同提交。 我正在使用 Angular CLI 構建一個 Angular 應用程序。 npm 任務調用“run build”,它在我的 package.json 中定義為“ng build --prod”。 成功的構建和失敗的構建都使用 npm 任務版本 1.1.49 和 npm 版本 6.8。 這讓我相信它與托管環境有關。 托管的 vs2017 和 vs2019 代理幾乎總是失敗。 而 Windows 容器代理失敗的概率約為 50%。

npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! my-app@1.0.0 build: `ng build --prod`
npm ERR! Exit status 134
npm ERR! 
npm ERR! Failed at the my-app@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\npm\cache\_logs\TimeStampHere-debug.log
Found npm debug log, make sure the path matches with the one in npm's output: C:\npm\cache\_logs\TimeStampHere-debug.log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\npm\\prefix\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'build' ]
2 info using npm@6.8.0
3 info using node@v10.15.2
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle my-app@1.0.0~prebuild: my-app@1.0.0
6 info lifecycle my-app@1.0.0~build: my-app@1.0.0
7 verbose lifecycle my-app@1.0.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle my-app@1.0.0~build: PATH: C:\npm\prefix\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;d:\a\1\s\ngmyapp\node_modules\.bin;C:\agents\2.149.2\externals\git\cmd;C:/hostedtoolcache/windows/Python/3.6.8/x64;C:/hostedtoolcache/windows/Python/3.6.8/x64/Scripts;C:\vcpkg;C:\cf-cli;C:\Program Files (x86)\NSIS\;C:\Program Files\Boost\1.69.0;C:\Users\VssAdministrator\.dotnet\tools;C:\Program Files\dotnet;C:\mysql-5.7.21-winx64\bin;C:\Program Files\Java\zulu-8-azure-jdk_8.36.0.1-8.0.202-win_x64\bin;C:\npm\prefix;C:\hostedtoolcache\windows\Ruby\2.5.0\x64\bin;C:\Go1.11.5\bin;C:\Program Files\Git\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\Scripts;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64;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)\Subversion\bin;C:\Program Files\nodejs\;C:\Program Files\CMake\bin;C:\Program Files\Mercurial;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Program Files\OpenSSL\bin;C:\Users\VssAdministrator\AppData\Local\Microsoft\WindowsApps;
9 verbose lifecycle my-app@1.0.0~build: CWD: d:\a\1\s\ngmyapp
10 silly lifecycle my-app@1.0.0~build: Args: [ '/d /s /c', 'ng build --prod' ]
11 silly lifecycle my-app@1.0.0~build: Returned: code: 134  signal: null
12 info lifecycle my-app@1.0.0~build: Failed to exec build script
13 verbose stack Error: my-app@1.0.0 build: `ng build --prod`
13 verbose stack Exit status 134
13 verbose stack     at EventEmitter.<anonymous> (C:\npm\prefix\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:189:13)
13 verbose stack     at ChildProcess.<anonymous> (C:\npm\prefix\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:189:13)
13 verbose stack     at maybeClose (internal/child_process.js:970:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid my-app@1.0.0
15 verbose cwd d:\a\1\s\myapp
16 verbose Windows_NT 10.0.14393
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\npm\\prefix\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
18 verbose node v10.15.2
19 verbose npm  v6.8.0
20 error code ELIFECYCLE
21 error errno 134
22 error my-app@1.0.0 build: `ng build --prod`
22 error Exit status 134
23 error Failed at the my-app@1.0.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 134, true ]

##[error]Error: Npm failed with return code: 134
##[section]Finishing: npm build

編輯:我已經在內部配置了一個構建代理,我沒有遇到這個問題。

大約 50% 的托管構建失敗,出現 npm 錯誤 134。我正在使用托管 vs2017 構建具有相同構建定義的相同提交。 我正在使用 Angular CLI 構建一個 Angular 應用程序。 npm 任務調用“run build”,它在我的 package.json 中定義為“ng build --prod”。 成功的構建和失敗的構建都使用 npm 任務版本 1.1.49 和 npm 版本 6.8。 這讓我相信它與托管環境有關。 托管的 vs2017 和 vs2019 代理幾乎總是失敗。 而 Windows 容器代理失敗的概率約為 50%。

npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! my-app@1.0.0 build: `ng build --prod`
npm ERR! Exit status 134
npm ERR! 
npm ERR! Failed at the my-app@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\npm\cache\_logs\TimeStampHere-debug.log
Found npm debug log, make sure the path matches with the one in npm's output: C:\npm\cache\_logs\TimeStampHere-debug.log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\npm\\prefix\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'build' ]
2 info using npm@6.8.0
3 info using node@v10.15.2
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle my-app@1.0.0~prebuild: my-app@1.0.0
6 info lifecycle my-app@1.0.0~build: my-app@1.0.0
7 verbose lifecycle my-app@1.0.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle my-app@1.0.0~build: PATH: C:\npm\prefix\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;d:\a\1\s\ngmyapp\node_modules\.bin;C:\agents\2.149.2\externals\git\cmd;C:/hostedtoolcache/windows/Python/3.6.8/x64;C:/hostedtoolcache/windows/Python/3.6.8/x64/Scripts;C:\vcpkg;C:\cf-cli;C:\Program Files (x86)\NSIS\;C:\Program Files\Boost\1.69.0;C:\Users\VssAdministrator\.dotnet\tools;C:\Program Files\dotnet;C:\mysql-5.7.21-winx64\bin;C:\Program Files\Java\zulu-8-azure-jdk_8.36.0.1-8.0.202-win_x64\bin;C:\npm\prefix;C:\hostedtoolcache\windows\Ruby\2.5.0\x64\bin;C:\Go1.11.5\bin;C:\Program Files\Git\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\Scripts;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64;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)\Subversion\bin;C:\Program Files\nodejs\;C:\Program Files\CMake\bin;C:\Program Files\Mercurial;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Program Files\OpenSSL\bin;C:\Users\VssAdministrator\AppData\Local\Microsoft\WindowsApps;
9 verbose lifecycle my-app@1.0.0~build: CWD: d:\a\1\s\ngmyapp
10 silly lifecycle my-app@1.0.0~build: Args: [ '/d /s /c', 'ng build --prod' ]
11 silly lifecycle my-app@1.0.0~build: Returned: code: 134  signal: null
12 info lifecycle my-app@1.0.0~build: Failed to exec build script
13 verbose stack Error: my-app@1.0.0 build: `ng build --prod`
13 verbose stack Exit status 134
13 verbose stack     at EventEmitter.<anonymous> (C:\npm\prefix\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
13 verbose stack     at EventEmitter.emit (events.js:189:13)
13 verbose stack     at ChildProcess.<anonymous> (C:\npm\prefix\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:189:13)
13 verbose stack     at maybeClose (internal/child_process.js:970:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid my-app@1.0.0
15 verbose cwd d:\a\1\s\myapp
16 verbose Windows_NT 10.0.14393
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\npm\\prefix\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
18 verbose node v10.15.2
19 verbose npm  v6.8.0
20 error code ELIFECYCLE
21 error errno 134
22 error my-app@1.0.0 build: `ng build --prod`
22 error Exit status 134
23 error Failed at the my-app@1.0.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 134, true ]

##[error]Error: Npm failed with return code: 134
##[section]Finishing: npm build

編輯:我已經在內部配置了一個構建代理,我沒有遇到這個問題。

在我們的例子中,問題是通過在 Azure 管道上添加 Node.js 工具安裝程序任務並指定我們用於開發的 Node 版本來解決的。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM