gpt4 book ai didi

node.js - 如何修复 travis-ci : FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory 中的以下构建错误

转载 作者:太空宇宙 更新时间:2023-11-03 23:14:30 26 4
gpt4 key购买 nike

npm run build 在本地运行时完美运行。

但是 travis-ci 总是远程失败并每次都会报告以下错误:

fatal error :CALL_AND_RETRY_LAST 分配失败 - JavaScript 堆内存不足

您可以在 react-hot-starter 找到完整的项目源代码

下面是错误脚本的完整堆栈跟踪:

$ npm run build
> react-hot-starter@0.1.0 build /home/travis/build/mateja176/react-hot-starter
> react-app-rewired build
Creating an optimized production build...
=============
WARNING: You are currently running a version of TypeScript which is not officially supported by typescript-estree.
You may find that it works just fine, or you may not.
SUPPORTED TYPESCRIPT VERSIONS: >=3.2.1 <3.5.0
YOUR TYPESCRIPT VERSION: 3.5.1
Please only submit bug reports when using the officially supported version.
=============
<--- Last few GCs --->
[5608:0x3b3c0c0] 245101 ms: Mark-sweep 1340.9 (1499.9) -> 1340.9 (1499.9) MB, 2567.3 / 0.0 ms allocation failure GC in old space requested
[5608:0x3b3c0c0] 247168 ms: Mark-sweep 1340.9 (1499.9) -> 1340.9 (1462.9) MB, 2066.0 / 0.0 ms last resort GC in old space requested
[5608:0x3b3c0c0] 249253 ms: Mark-sweep 1340.9 (1462.9) -> 1340.9 (1458.9) MB, 2084.1 / 0.0 ms last resort GC in old space requested
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x308ac3925891 <JSObject>
1: /* anonymous */ [/home/travis/build/mateja176/react-hot-starter/node_modules/webpack-sources/node_modules/source-map/lib/source-map-generator.js:~48] [pc=0x8c72146985d](this=0x334130f8c2f1 <JSGlobal Object>,mapping=0xb9561a06929 <Object map = 0x153806e6a799>)
2: arguments adaptor frame: 3->1
3: forEach(this=0x3b0e579f49 <JSArray[407127]>)
4: SourceMapConsumer_eachMapping [/hom...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: node::Abort() [node]
2: 0x8cd14c [node]
3: v8::Utils::ReportOOMFailure(char const*, bool) [node]
4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [node]
5: v8::internal::Factory::NewUninitializedFixedArray(int) [node]
6: 0xd83553 [node]
7: v8::internal::Runtime_GrowArrayElements(int, v8::internal::Object**, v8::internal::Isolate*) [node]
8: 0x8c7204842fd
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-hot-starter@0.1.0 build: `react-app-rewired build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-hot-starter@0.1.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! /home/travis/.npm/_logs/2019-07-28T20_47_44_520Z-debug.log
The command "npm run build" exited with 1.

最佳答案

尝试在 Travis.yml 的 before_script 中包含以下行:

导出 NODE_OPTIONS=--max_old_space_size=4096

导出 NODE_OPTIONS=--max_old_space_size=8192

它为我们解决了这个问题。

关于node.js - 如何修复 travis-ci : FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory 中的以下构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57244947/

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