4
votes

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

enter image description here

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! [email protected] 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 [email protected] 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 [email protected]
2020-01-03T10:29:10.4549449Z 3 info using [email protected]
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 [email protected]~prebuild-prod: [email protected]
2020-01-03T10:29:10.4551853Z 6 info lifecycle [email protected]~build-prod: [email protected]
2020-01-03T10:29:10.4551919Z 7 verbose lifecycle [email protected]~build-prod: unsafe-perm in lifecycle true
2020-01-03T10:29:10.4552353Z 8 verbose lifecycle [email protected]~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 [email protected]~build-prod: CWD: D:\a\1\s
2020-01-03T10:29:10.4552885Z 10 silly lifecycle [email protected]~build-prod: Args: [ '/d /s /c', 'ng build --prod' ]
2020-01-03T10:29:10.4552932Z 11 silly lifecycle [email protected]~build-prod: Returned: code: 3  signal: null
2020-01-03T10:29:10.4552974Z 12 info lifecycle [email protected]~build-prod: Failed to exec build-prod script
2020-01-03T10:29:10.4553028Z 13 verbose stack Error: [email protected] 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 [email protected]
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 [email protected] 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 [email protected] 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

1 Answers

2
votes

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.