- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
在 Angular 7.1 升级后,我收到 fatal error :CALL_AND_RETRY_LAST 分配失败 - JavaScript 堆内存不足。之前的 6.1 版本运行良好。
我在运行 ng build --prod
命令时仅在 Azure DevOps 中收到错误。它在本地构建得非常好。
下面是详细日志。知道为什么我会收到此错误吗?
2018-11-22T06:40:36.2804965Z ##[section]Starting: npm build
2018-11-22T06:40:36.2809301Z ==============================================================================
2018-11-22T06:40:36.2809365Z Task : npm
2018-11-22T06:40:36.2809456Z Description : Install and publish npm packages, or run an npm command. Supports npmjs.com and authenticated registries like Package Management.
2018-11-22T06:40:36.2809496Z Version : 1.0.27
2018-11-22T06:40:36.2809531Z Author : Microsoft Corporation
2018-11-22T06:40:36.2809612Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613746)
2018-11-22T06:40:36.2809648Z ==============================================================================
2018-11-22T06:40:36.7158800Z SYSTEMVSSCONNECTION exists true
2018-11-22T06:40:36.8019327Z SYSTEMVSSCONNECTION exists true
2018-11-22T06:40:36.8872807Z [command]C:\Windows\system32\cmd.exe /D /S /C ""C:\Program Files\nodejs\npm.cmd" --version"
2018-11-22T06:40:37.5174051Z 6.4.1
2018-11-22T06:40:38.9461529Z [command]C:\Windows\system32\cmd.exe /D /S /C ""C:\Program Files\nodejs\npm.cmd" config list"
2018-11-22T06:40:39.5927698Z ; cli configs
2018-11-22T06:40:39.5928553Z metrics-registry = "https://registry.npmjs.org/"
2018-11-22T06:40:39.5929006Z scope = ""
2018-11-22T06:40:39.5929176Z user-agent = "npm/6.4.1 node/v8.12.0 win32 x64"
2018-11-22T06:40:39.5929292Z
2018-11-22T06:40:39.5929425Z ; environment configs
2018-11-22T06:40:39.5929577Z cache = "C:\\npm\\cache"
2018-11-22T06:40:39.5929756Z prefix = "C:\\npm\\prefix"
2018-11-22T06:40:39.5929899Z userconfig = "D:\\a\\1\\npm\\17729.npmrc"
2018-11-22T06:40:39.5930010Z
2018-11-22T06:40:39.5930159Z ; builtin config undefined
2018-11-22T06:40:39.5930270Z
2018-11-22T06:40:39.5930403Z ; node bin location = C:\Program Files\nodejs\node.exe
2018-11-22T06:40:39.5930552Z ; cwd = D:\a\1\s\client
2018-11-22T06:40:39.5930686Z ; HOME = C:\Users\VssAdministrator
2018-11-22T06:40:39.5930817Z ; "npm config ls -l" to show all defaults.
2018-11-22T06:40:39.5930928Z
2018-11-22T06:40:39.5931996Z [command]C:\Windows\system32\cmd.exe /D /S /C ""C:\Program Files\nodejs\npm.cmd" run build"
2018-11-22T07:33:30.0639548Z FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
2018-11-22T07:33:30.0640628Z 1: node_module_register
2018-11-22T07:33:30.0640676Z 2: v8::internal::FatalProcessOutOfMemory
2018-11-22T07:33:30.0640710Z 3: v8::internal::FatalProcessOutOfMemory
2018-11-22T07:33:30.0640744Z 4: v8::internal::Factory::NewRawTwoByteString
2018-11-22T07:33:30.0640825Z 5: v8::internal::Smi::SmiPrint
2018-11-22T07:33:30.0640861Z 6: v8::internal::StackGuard::HandleInterrupts
2018-11-22T07:33:30.0640894Z 7: v8::internal::AsmJsScanner::IsNumberStart
2018-11-22T07:33:30.0640967Z 8: 000002B496D043C1
2018-11-22T07:33:30.0641001Z npm ERR! code ELIFECYCLE
2018-11-22T07:33:30.0641034Z npm ERR! errno 3
2018-11-22T07:33:30.0641210Z npm ERR! iceux@0.0.1 build: `ng build --prod`
2018-11-22T07:33:30.0641470Z npm ERR! Exit status 3
2018-11-22T07:33:30.0641528Z npm ERR!
2018-11-22T07:33:30.0641569Z npm ERR! Failed at the iceux@0.0.1 build script.
2018-11-22T07:33:30.0641615Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-11-22T07:33:30.0641703Z
2018-11-22T07:33:30.0641749Z npm ERR! A complete log of this run can be found in:
2018-11-22T07:33:30.0641795Z npm ERR! C:\npm\cache\_logs\2018-11-22T07_33_30_018Z-debug.log
2018-11-22T07:33:30.0641823Z
2018-11-22T07:33:30.0641910Z > iceux@0.0.1 build D:\a\1\s\client
2018-11-22T07:33:30.0641951Z > ng build --prod
2018-11-22T07:33:30.0641978Z
2018-11-22T07:33:30.1213960Z Found npm debug log, make sure the path matches with the one in npm's output: C:\npm\cache\_logs\2018-11-22T07_33_30_018Z-debug.log
2018-11-22T07:33:30.1214046Z 0 info it worked if it ends with ok
2018-11-22T07:33:30.1214104Z 1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
2018-11-22T07:33:30.1214189Z 1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
2018-11-22T07:33:30.1215590Z 1 verbose cli 'run',
2018-11-22T07:33:30.1215635Z 1 verbose cli 'build' ]
2018-11-22T07:33:30.1215667Z 2 info using npm@6.4.1
2018-11-22T07:33:30.1215727Z 3 info using node@v8.12.0
2018-11-22T07:33:30.1215759Z 4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
2018-11-22T07:33:30.1215801Z 5 info lifecycle iceux@0.0.1~prebuild: iceux@0.0.1
2018-11-22T07:33:30.1215835Z 6 info lifecycle iceux@0.0.1~build: iceux@0.0.1
2018-11-22T07:33:30.1216048Z 7 verbose lifecycle iceux@0.0.1~build: unsafe-perm in lifecycle true
2018-11-22T07:33:30.1216372Z 8 verbose lifecycle iceux@0.0.1~build: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\a\1\s\client\node_modules\.bin;C:\agents\2.141.1\externals\git\cmd;C:\tools\mingw64\bin;C:\Program Files\dotnet;C:\mysql-5.7.21-winx64\bin;C:\Program Files\Java\jdk1.8.0_181\bin;C:\npm\prefix;C:\hostedtoolcache\windows\Ruby\2.5.0\x64\bin;C:\Go1.11\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\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\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\Git\cmd;C:\Program Files (x86)\Subversion\bin;C:\Program Files\nodejs\;C:\Program Files\CMake\bin;C:\Users\VssAdministrator\AppData\Local\Microsoft\WindowsApps
2018-11-22T07:33:30.1216877Z 9 verbose lifecycle iceux@0.0.1~build: CWD: D:\a\1\s\client
2018-11-22T07:33:30.1216979Z 10 silly lifecycle iceux@0.0.1~build: Args: [ '/d /s /c', 'ng build --prod' ]
2018-11-22T07:33:30.1217028Z 11 silly lifecycle iceux@0.0.1~build: Returned: code: 3 signal: null
2018-11-22T07:33:30.1217062Z 12 info lifecycle iceux@0.0.1~build: Failed to exec build script
2018-11-22T07:33:30.1217103Z 13 verbose stack Error: iceux@0.0.1 build: `ng build --prod`
2018-11-22T07:33:30.1217135Z 13 verbose stack Exit status 3
2018-11-22T07:33:30.1217173Z 13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
2018-11-22T07:33:30.1217215Z 13 verbose stack at emitTwo (events.js:126:13)
2018-11-22T07:33:30.1217250Z 13 verbose stack at EventEmitter.emit (events.js:214:7)
2018-11-22T07:33:30.1217287Z 13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
2018-11-22T07:33:30.1217332Z 13 verbose stack at emitTwo (events.js:126:13)
2018-11-22T07:33:30.1217381Z 13 verbose stack at ChildProcess.emit (events.js:214:7)
2018-11-22T07:33:30.1217413Z 13 verbose stack at maybeClose (internal/child_process.js:915:16)
2018-11-22T07:33:30.1217448Z 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
2018-11-22T07:33:30.1217488Z 14 verbose pkgid iceux@0.0.1
2018-11-22T07:33:30.1217521Z 15 verbose cwd D:\a\1\s\client
2018-11-22T07:33:30.1217551Z 16 verbose Windows_NT 10.0.14393
2018-11-22T07:33:30.1217588Z 17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
2018-11-22T07:33:30.1217629Z 18 verbose node v8.12.0
2018-11-22T07:33:30.1217659Z 19 verbose npm v6.4.1
2018-11-22T07:33:30.1217690Z 20 error code ELIFECYCLE
2018-11-22T07:33:30.1217727Z 21 error errno 3
2018-11-22T07:33:30.1218070Z 22 error iceux@0.0.1 build: `ng build --prod`
2018-11-22T07:33:30.1218102Z 22 error Exit status 3
2018-11-22T07:33:30.1218134Z 23 error Failed at the iceux@0.0.1 build script.
2018-11-22T07:33:30.1218187Z 23 error This is probably not a problem with npm. There is likely additional logging output above.
2018-11-22T07:33:30.1218220Z 24 verbose exit [ 3, true ]
2018-11-22T07:33:30.1218241Z
2018-11-22T07:33:30.1286371Z ##[error]Error: Npm failed with return code: 3
2018-11-22T07:33:30.1298403Z ##[section]Finishing: npm build
包.json
{
"name": "iceux",
"version": "0.0.1",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve --ssl true",
"build": "ng build --prod",
"test": "ng test",
"testauto": "ng test --watch=false --browsers=ChromeHeadless --code-coverage",
"lint": "ng lint iceux --format stylish",
"pree2e": "webdriver-manager update",
"e2e": "ng e2e --dev-server-target=iceux:serve",
"e2e:fast": "ng e2e --configuration=fast",
"e2e:azure": "ng e2e --configuration=azure",
"e2e:perf": "ng e2e --configuration=perf"
},
"private": true,
"dependencies": {
"@angular/animations": "7.1.0",
"@angular/common": "7.1.0",
"@angular/compiler": "7.1.0",
"@angular/core": "7.1.0",
"@angular/forms": "7.1.0",
"@angular/http": "7.1.0",
"@angular/platform-browser": "7.1.0",
"@angular/platform-browser-dynamic": "7.1.0",
"@angular/router": "7.1.0",
"@epicor/kinetic": "^2.1.0-alpha.20",
"@ngrx/effects": "^6.1.0",
"@ngrx/entity": "^6.1.0",
"@ngrx/store": "^6.1.0",
"@ngrx/store-devtools": "^6.1.0",
"@progress/kendo-angular-inputs": "^3.1.3",
"@progress/kendo-angular-intl": "^1.4.1",
"@progress/kendo-angular-l10n": "^1.2.0",
"@progress/kendo-angular-layout": "^3.1.1",
"@progress/kendo-angular-menu": "^1.0.0",
"@progress/kendo-angular-toolbar": "^0.2.1",
"@progress/kendo-angular-treeview": "^2.2.0",
"@progress/kendo-theme-default": "latest",
"@telerik/kendo-intl": "^1.4.4",
"angular2-query-builder": "^0.3.3",
"core-js": "^2.5.5",
"json-logic-js": "^1.2.2",
"lodash": "^4.17.10",
"logrocket": "^0.6.17",
"rxjs": "^6.3.3",
"rxjs-compat": "^6.0.0",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.10.0",
"@angular/cli": "7.0.6",
"@angular/compiler-cli": "7.1.0",
"@angular/language-service": "7.1.0",
"@ngrx/schematics": "^6.1.0",
"@types/jasmine": "^2.8.7",
"@types/jasminewd2": "~2.0.2",
"@types/lodash": "^4.14.108",
"@types/node": "~8.9.4",
"codelyzer": "^4.3.0",
"jasmine-core": "~2.99.1",
"jasmine-reporters": "^2.3.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "^1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "^5.4.1",
"rxjs-tslint": "^0.1.5",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.1.6"
}
}
最佳答案
尝试像这样运行产品构建:
node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --prod
我昨天遇到了同样的错误,它帮助我避免了它。
关于angular - 使用 Azure DevOps 的 Angular 7 中的 JavaScript 堆内存不足,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53435533/
我正在尝试在项目中学习和添加 Angular 国际化。我只能理解 Angular 文档 (https://angular.io/guide/i18n-overview) 的编译时翻译。 我需要这样的东
在我的 Angular 应用程序中,基于登录用户,我想通过显示/隐藏不同的菜单项或允许/禁止某些路由来授予或限制功能。 目前成功登录后,我的 .NET Core API 会返回一个 JWT token
我是 Angular 的新手,目前我已经看过 angular.io 网站提供的一些示例。但是在component decorator在文档中的解释,它指出 Angular components are
这里是service employee-service.service.ts的代码 import { Injectable } from '@angular/core'; import { HttpC
我目前正在使用@angular/http URLSearchParams 类来检索 URL 参数。在 Angular 5 中,注意到这已被弃用,但我没有看到以我当前使用的方式替换 URLSearchP
我目前正在使用@angular/http URLSearchParams 类来检索 URL 参数。在 Angular 5 中,注意到这已被弃用,但我没有看到以我当前使用的方式替换 URLSearchP
如何正确安装 PUG/JADE 到 Angular 2 或更高版本 这样在工作和 AOT 和 JiT 的同时 工作单元和集成测试 并且在创建每个新组件时不会受到太多影响 最佳答案 我看到了很多解决方案
我的 Angular 12 应用程序中有一些通用组件,我计划将其创建为一个 Angular 库,以便其他应用程序也可以使用它。我们有一些应用程序在较低版本的 angular(例如 angular 8/
tl;dr; ng build 删除了包含我编译的自定义库的/dist 文件夹。这会使我项目代码中对该库的所有引用无效,从而导致 ng build 最终失败。我做错了什么? 我关注了documenta
我正在将一些“遗留”(非 typescript )js 库导入到我的 Angular SPA 中。 通常我只是从 cdn 添加一个负载到 index.html 就像: 在 Angular 分量中我只
我有这个 angular 应用程序,它基本上使用了库的概念。 我有 2 个名为 的库Lib1 和 lib2 根据他们所服务的微服务分组。 现在我将这些库导入主应用程序,即 应用1 事情一直到现在。 现
我在我的项目中启用了 angular Universal。我现在想完全删除它。我试图删除以下文件 /server.ts /webpack.server.config.js /src/tsconfig.
我已经有一个 AuthService 在登录时对用户进行身份验证,并且 AuthGuard 在未登录的情况下阻止访问。 某些页面我通过 UserProfile/Role 限制访问,但现在我需要阻止页面
我正在尝试使用 angular、TypeORM、SQLite 和其他组件作为 webpack 构建 Electron 应用程序。 我从在 GitHub 上找到的示例开始我的开发:https://git
我在从 Angular 8 更新到 9 并运行时遇到以下错误 ng 更新@angular/material: Package "@angular/flex-layout" has an incompa
我正在尝试使用 Angular 9,我想创建一个项目,然后创建一个库项目并开始向其中添加我想稍后在 GitHub 上发布的通用模块,并在我的本地使用这些库项目。 相关依赖如下: Angular CLI
我正在尝试使用 Angular 9,我想创建一个项目,然后创建一个库项目并开始向其中添加我想稍后在 GitHub 上发布的通用模块,并在我的本地使用这些库项目。 相关依赖如下: Angular CLI
我正在我的 h1 元素“之前”创建一个小的程式化三 Angular 形图案,但我无法正确地圆 Angular 。右上角没问题,但其他两个有剪裁问题。 这是输出以及形状的放大图像: 使用的代码如下: h
我有一个 Angular 元素,带有自定义标记名 - fancy-button。如何将 fancy-button 嵌入 Angular 应用程序? 我已经尝试了以下方法,但都没有用 - 在 index
我已将我的项目从 angular 5.2.9 升级到 angular 6.0.0-rc.5。 除了包路径中的几个快速 RxJS 修复外,一切看起来都不错。(此链接非常有用:Want to upgrad
我是一名优秀的程序员,十分优秀!