首页 > 解决方案 > 反应应用。npm run build 后出现致命错误

问题描述

运行“npm run build”时出现错误:

节点脚本/build.js

创建优化的生产构建...

<--- 最近几次 GC --->

[432:0x38f0d20] 440313 ms:Mark-sweep 1356.4 (1439.3) -> 1356.3 (1439.8) MB,673.6 / 0.0 ms 分配失败 GC 在旧空间请求 [432:0x38f0d20] 440848 ms:Mark-sweep 1356.3 (1439.8) > 1356.3 (1420.3) MB, 534.3 / 0.0 ms 最后手段 GC 在旧空间请求 [432:0x38f0d20] 441238 ms: 标记扫描 1356.3 (1420.3) -> 1356.3 (1420.3) MB, 389.8 / 0.0 ms 最后手段 GC 在旧要求的空间

<--- JS 堆栈跟踪 --->

==== JS 堆栈跟踪 ==========================================

安全上下文:0x112153c25879 0:内置退出框架:stringify(this=0x112153c090a9 ,0x1863fd022d1 ,0x1863fd022d1 ,0x3befa98ff2f1 )

1: arguments adaptor frame: 1->3
2: /* anonymous */(aka /* anonymous */) [/var/www/tixxio.loc/node_modules/webpack/lib/SourceMapDevToolPlugin.js:173]

[字节码=0x2534cd2bf819 偏移量=238](这=0x1863fd022d...

internal::JsonStringifier::Serialize_(v8::internal::Handle, bool, v8::internal::Handle) [节点] 11: v8::internal::JsonStringifier::Result v8::internal::JsonStringifier:: Serialize_(v8::internal::Handle, bool, v8::internal::Handle) [节点] 12: v8::internal::JsonStringifier::Stringify(v8::internal::Handle, v8::internal::句柄,v8::internal::Handle) [node] 13: v8::internal::Builtin_JsonStringify(int, v8::internal::Object**, v8::internal::Isolate*) [node] 14: 0x33d5b940697d中止(核心转储)npm ERR!代码 ELIFECYCLE npm 错误!错误号 134 npm 错误!tixxio@0.1.0 构建:JsonStringifier::Stringify(v8::internal::Handle, v8::internal::Handle, v8::internal::Handle) [节点] 13: v8::internal::Builtin_JsonStringify(int, v8::internal::对象**,v8::internal::Isolate*) [node] 14: 0x33d5b940697d 中止(核心转储)npm ERR!代码 ELIFECYCLE npm 错误!错误号 134 npm 错误!tixxio@0.1.0 构建:JsonStringifier::Stringify(v8::internal::Handle, v8::internal::Handle, v8::internal::Handle) [节点] 13: v8::internal::Builtin_JsonStringify(int, v8::internal::对象**,v8::internal::Isolate*) [node] 14: 0x33d5b940697d 中止(核心转储)npm ERR!代码 ELIFECYCLE npm 错误!错误号 134 npm 错误!tixxio@0.1.0 构建:node scripts/build.jsnpm 错误!退出状态 134 npm ERR!npm 错误!tixxio@0.1.0 构建脚本失败。npm 错误!这可能不是 npm 的问题。上面可能有额外的日志输出。

npm 错误!可以在以下位置找到此运行的完整日志:npm ERR!
/home/ihor/.npm/_logs/2018-08-20T09_54_34_401Z-debug.log

此运行的完整日志:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'build' ]
2 info using npm@6.3.0
3 info using node@v8.11.2
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle tixxio@0.1.0~prebuild: tixxio@0.1.0
6 info lifecycle tixxio@0.1.0~build: tixxio@0.1.0
7 verbose lifecycle tixxio@0.1.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle tixxio@0.1.0~build: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/var/www/tixxio.loc/node_modules/.bin:/home/ihor/bin:/home/ihor/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/home/ihor/Android/Sdk/tools:/home/ihor/Android/Sdk/platform-tools
9 verbose lifecycle tixxio@0.1.0~build: CWD: /var/www/tixxio.loc
10 silly lifecycle tixxio@0.1.0~build: Args: [ '-c', 'node scripts/build.js' ]
11 silly lifecycle tixxio@0.1.0~build: Returned: code: 134  signal: null
12 info lifecycle tixxio@0.1.0~build: Failed to exec build script
13 verbose stack Error: tixxio@0.1.0 build: `node scripts/build.js`
13 verbose stack Exit status 134
13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:304:16)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at EventEmitter.emit (events.js:214:7)
13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at ChildProcess.emit (events.js:214:7)
13 verbose stack     at maybeClose (internal/child_process.js:925:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid tixxio@0.1.0
15 verbose cwd /var/www/tixxio.loc
16 verbose Linux 4.15.0-32-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "build"
18 verbose node v8.11.2
19 verbose npm  v6.3.0
20 error code ELIFECYCLE
21 error errno 134
22 error tixxio@0.1.0 build: `node scripts/build.js`
22 error Exit status 134
23 error Failed at the tixxio@0.1.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 134, true ]

我已经更新了所有依赖项。我该如何解决这个错误?谢谢你的建议。

标签: reactjsnpm

解决方案


推荐阅读