We have an automated build that downloads npm, runs the build, and deploys to Azure blob storage. We're using the latest version (8.9.2). The angular project runs fine in development using npm start and builds without error using npm run publish
In development, we do get three warnings. The first two are at the beginning of the build:
Warning: Entry point 'abp-ng2-module' contains deep imports into 'C:/..../angular/node_modules/rxjs/internal/observable/throwError'. This is probably not a problem, but may cause the compilation of entry points to be out of order. Warning: Entry point 'angular2-text-mask' contains deep imports into 'C:/..../angular/node_modules/text-mask-core/dist/textMaskCore'. This is probably not a problem, but may cause the compilation of entry points to be out of order.
The third is at the end of the build:
WARNING in Exceeded maximum budget for C:/..../angular/src/app/admin/subscription-management/invoice/invoice.component.less. Budget 6 kB was not met by 1.73 kB with a total of 7.73 kB.
During the automated build, we get the following error (sorry for how long this post is):
2020-06-11T17:14:43.0410088Z Compiling primeng : module as esm5 2020-06-11T17:14:43.0410500Z FATAL ERROR: NewArray Allocation failed - process out of memory 2020-06-11T17:14:43.0410726Z 1: 00007FF70011470F
followed by a long stack dump.
2020-06-11T17:14:43.0429465Z 80: 00007FFAD5F684D4 2020-06-11T17:14:43.0429620Z 81: 00007FFAD607E871 RtlUserThreadStart+33 2020-06-11T17:14:43.0429893Z FATAL ERROR: NewSpace::Rebalance Allocation failed - JavaScript heap out of memory 2020-06-11T17:14:43.0430107Z 1: 00007FF70011470F
followed by more stack dump.
2020-06-11T17:14:43.0432221Z 16: 0000020F4108AC76 2020-06-11T17:14:43.0432406Z FATAL ERROR: NewArray Allocation failed - process out of memory 2020-06-11T17:14:43.0432775Z 1: 00007FF70011470F napi_wrap+113583 2020-06-11T17:14:43.0433006Z 2: 00007FF7000BF7D6 v8::base::CPU::has_sse+66646 2020-06-11T17:14:43.0433280Z 3: 00007FF7000C05D6 v8::base::CPU::has_sse+70230 2020-06-11T17:14:43.0433577Z 4: 00007FF7008D42EE v8::Isolate::ReportExternalAllocationLimitReached+94 2020-06-11T17:14:43.0434280Z 5: 00007FF7008BC3C1 v8::SharedArrayBuffer::Externalize+833 2020-06-11T17:14:43.0434574Z 6: 00007FF7008BC3EC v8::internal::FatalProcessOutOfMemory+12 2020-06-11T17:14:43.0434867Z 7: 00007FF7005BD728 v8::internal::ParseInfo::set_script+744 2020-06-11T17:14:43.0435213Z 8: 00007FF7005BD4FC v8::internal::ParseInfo::set_script+188 2020-06-11T17:14:43.0435505Z 9: 00007FF70057C62E v8::internal::Scanner::ScanString+238 2020-06-11T17:14:43.0435791Z 10: 00007FF700576808 v8::internal::Scanner::Next+2008 2020-06-11T17:14:43.0436148Z 11: 00007FF70059102C v8::internal::ParserBase<v8::internal::Parser>::ParseObjectPropertyDefinition+300
followed by further stack trace info
2020-06-11T17:14:43.0464829Z 76: 00007FF7000763A1 v8::internal::AsmJsScanner::GetIdentifierString+31777 2020-06-11T17:14:43.0465100Z 77: 00007FF7000E90E3 node::Start+275 2020-06-11T17:14:43.0465306Z 78: 00007FF6FFF56A9C RC4_options+340380 2020-06-11T17:14:43.0465618Z 79: 00007FF700DDF8C8 v8::internal::SetupIsolateDelegate::SetupHeap+1300536 2020-06-11T17:14:43.0465892Z 80: 00007FFAD5F684D4 BaseThreadInitThunk+20 2020-06-11T17:14:43.0466097Z 81: 00007FFAD607E871 RtlUserThreadStart+33 2020-06-11T17:14:43.0466308Z events.js:292 2020-06-11T17:14:43.0466478Z throw er; // Unhandled 'error' event 2020-06-11T17:14:43.0466705Z ^ 2020-06-11T17:14:43.0466794Z 2020-06-11T17:14:43.0466916Z Error: write UNKNOWN 2020-06-11T17:14:43.0467183Z at ChildProcess.target._send (internal/child_process.js:806:20) 2020-06-11T17:14:43.0467472Z at ChildProcess.target.send (internal/child_process.js:677:19) 2020-06-11T17:14:43.0467860Z at ChildProcessWorker._onExit (D:\a\9\s\node_modules\jest-worker\build\workers\ChildProcessWorker.js:310:21) 2020-06-11T17:14:43.0472281Z at ChildProcess.emit (events.js:315:20) 2020-06-11T17:14:43.0472623Z at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12) 2020-06-11T17:14:43.0472914Z Emitted 'error' event on ChildProcess instance at: 2020-06-11T17:14:43.0473154Z at internal/child_process.js:810:39 2020-06-11T17:14:43.0473448Z at processTicksAndRejections (internal/process/task_queues.js:79:11) { 2020-06-11T17:14:43.0473672Z errno: 'UNKNOWN', 2020-06-11T17:14:43.0473824Z code: 'UNKNOWN', 2020-06-11T17:14:43.0473980Z syscall: 'write' 2020-06-11T17:14:43.0474144Z } 2020-06-11T17:14:43.0474270Z npm ERR! code ELIFECYCLE 2020-06-11T17:14:43.0474415Z npm ERR! errno 1 2020-06-11T17:14:43.0474645Z npm ERR! [email protected] publish:
gulp build && ng build --prod
2020-06-11T17:14:43.0474922Z npm ERR! Exit status 1 2020-06-11T17:14:43.0475054Z npm ERR! 2020-06-11T17:14:43.0475242Z npm ERR! Failed at the [email protected] publish script. 2020-06-11T17:14:43.0475555Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 2020-06-11T17:14:43.0475800Z 2020-06-11T17:14:43.0475984Z npm ERR! A complete log of this run can be found in: 2020-06-11T17:14:43.0476264Z npm ERR! C:\npm\cache_logs\2020-06-11T17_14_42_548Z-debug.log
...
2020-06-11T17:14:44.2461677Z 13 verbose stack Error: [email protected] publish:
gulp build && ng build --prod
2020-06-11T17:14:44.2461971Z 13 verbose stack Exit status 1 2020-06-11T17:14:44.2462514Z 13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16) 2020-06-11T17:14:44.2463023Z 13 verbose stack at EventEmitter.emit (events.js:315:20) 2020-06-11T17:14:44.2463537Z 13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14) 2020-06-11T17:14:44.2463998Z 13 verbose stack at ChildProcess.emit (events.js:315:20) 2020-06-11T17:14:44.2464356Z 13 verbose stack at maybeClose (internal/child_process.js:1021:16) 2020-06-11T17:14:44.2464709Z 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) 2020-06-11T17:14:44.2465012Z 14 verbose pkgid [email protected] 2020-06-11T17:14:44.2465242Z 15 verbose cwd D:\a\9\s 2020-06-11T17:14:44.2465433Z 16 verbose Windows_NT 10.0.14393 2020-06-11T17:14:44.2465923Z 17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run-script" "publish" 2020-06-11T17:14:44.2466268Z 18 verbose node v12.18.0 2020-06-11T17:14:44.2466453Z 19 verbose npm v6.14.4 2020-06-11T17:14:44.2466607Z 20 error code ELIFECYCLE 2020-06-11T17:14:44.2466924Z 21 error errno 1 2020-06-11T17:14:44.2467274Z 22 error [email protected] publish:gulp build && ng build --prod
2020-06-11T17:14:44.2467538Z 22 error Exit status 1 2020-06-11T17:14:44.2467740Z 23 error Failed at the [email protected] publish script. 2020-06-11T17:14:44.2468042Z 23 error This is probably not a problem with npm. There is likely additional logging output above. 2020-06-11T17:14:44.2468299Z 24 verbose exit [ 1, true ] 2020-06-11T17:14:44.2468441Z 2020-06-11T17:14:44.2765275Z ##[error]Error: Npm failed with return code: 1 2020-06-11T17:14:44.2876847Z ##[section]Finishing: npm run build
We're using Azure Piplines. Any help would be greatly appreciated.