npm在create-react-app上运行构建ERR errno 134

问题描述

我使用create-react-app创建了一个应用程序,并使用Ubuntu 18.04.3将其部署到Digital Ocean Droplet中

使用节点v13.14.0 npm 6.14.6

我运行了导出NODE_OPTIONS =“-max-old-space-size = 8192”

现在,当我尝试npm run build时,我得到errno134。日志不是那么具有描述性

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node','/usr/local/bin/npm','run','build' ]
2 info using npm@6.14.6
3 info using node@v12.18.3
4 verbose run-script [ 'prebuild','build','postbuild' ]
5 info lifecycle myapp@0.1.0~prebuild: myapp@0.1.0
6 info lifecycle myapp@0.1.0~build: myapp@0.1.0
7 verbose lifecycle myapp@0.1.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle myapp@0.1.0~build: PATH: /usr/local/lib/node_modules/npm$
9 verbose lifecycle myapp@0.1.0~build: CWD: /home/david/myapp
10 silly lifecycle myapp@0.1.0~build: Args: [ '-c','node scripts/build.js' ]
11 silly lifecycle myapp@0.1.0~build: Returned: code: 134  signal: null
12 info lifecycle myapp@0.1.0~build: Failed to exec build script
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_pro$
14 verbose pkgid myapp@0.1.0
15 verbose cwd /home/david/myapp
16 verbose Linux 4.15.0-112-generic
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
18 verbose node v12.18.3
19 verbose npm  v6.14.6
20 error code ELIFECYCLE
21 error errno 134
22 error myapp@0.1.0 build: `node scripts/build.js`
22 error Exit status 134
23 error Failed at the myapp@0.1.0 build script.
23 error This is probably not a problem with npm. There is likely additional lo$
24 verbose exit [ 134,true ]

我有这个堆栈跟踪:

==== JS stack trace =========================================

    0: ExitFrame [pc: 0x13cf019]
    1: StubFrame [pc: 0x1355ea1]
Security context: 0x2a40369408d1 <JSObject>
    2: _replaceInStringNode [0x1687370870e9] [/home/david/myapp/node_modules/webpack-sources/lib/ReplaceSource.js:~194] [pc=0x2c71cda9f975](this=0x035173805049 <Source map = 0x336c4ecf7cf9>,0x01fcf43b97f1 <JSArray[309]>,0x01fcf43b97a1 <ReplacementEnumerator map = 0x13294d6fe199>,0x01fcf43ba361 <JSFunction getOriginalSource (sfi...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0xa093f0 node::Abort() [node]
 2: 0xa097fc node::OnFatalError(char const*,char const*) [node]
 3: 0xb842ae v8::Utils::ReportOOMFailure(v8::internal::Isolate*,char const*,bool) [node]
 4: 0xb84629 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*,bool) [node]
 5: 0xd30fe5  [node]
 6: 0xd31676 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [node]
 7: 0xd3def5 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector,v8::GCCallbackFlags) [node]
 8: 0xd3eda5 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace,v8::internal::GarbageCollectionReason,v8::GCCallbackFlags) [node]
 9: 0xd4185c v8::internal::Heap::AllocateRawWithRetryOrFail(int,v8::internal::AllocationType,v8::internal::AllocationOrigin,v8::internal::AllocationAlignment) [node]
10: 0xd0830b v8::internal::Factory::NewFillerObject(int,bool,v8::internal::AllocationOrigin) [node]
11: 0x1049f4e v8::internal::Runtime_AllocateInYoungGeneration(int,unsigned long*,v8::internal::Isolate*) [node]
12: 0x13cf019  [node]
Aborted (core dumped)

在我的本地环境中可以正常工作吗?

我尝试降级节点,但它给了我137错误。似乎是内存问题,但是我应该有足够的内存吗?当我恢复到可以正常工作的仓库的先前版本时,它也无法构建?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...