NPM发布会产生致命错误:CALL_AND_RETRY_LAST分配失败-JavaScript堆内存不足

时间:2018-11-24 23:45:44

标签: node.js npm npm-publish

我正在尝试发布一个npm软件包。但是在给出命令npm publish时出现此错误。

JS stacktrace

Security context: 0000013BB24A57C1 <JSObject>

 1: _writeGeneric [net.js:765] [bytecode=0000017102067151 offset=351](this=000000B0CC896439 <TLSSocket map = 000003E535A4BF21>,writev=0000009710482371 <true>
,data=0000030A8AB92831 <JSArray[2]>,encoding=0000009710482431 <String[0]: >,cb=000000B0CC896CA9 <JSBoundFunction (BoundTargetFunction 0000019FF9638929)>)

2: connect [net.js:729] [bytecode=0000013622F65119 offset=29](this=000000B0CC8...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

 1: node_module_register

 2: v8::internal::FatalProcessOutOfMemory

 3: v8::internal::FatalProcessOutOfMemory

 4: v8::internal::Factory::NewRawTwoByteString

 5: v8::internal::Smi::SmiPrint

 6: v8::internal::StackGuard::HandleInterrupts

 7: v8::String::WriteUtf8

 8: v8_inspector::V8InspectorClient::currentTimeMS

 9: v8_inspector::V8InspectorClient::currentTimeMS

10: uv_loop_size

11: v8::internal::wasm::SignatureMap::Find

12: v8::internal::Builtins::CallableFor

13: v8::internal::Builtins::CallableFor

14: v8::internal::Builtins::CallableFor

15: 000001E9D12843C1

我还尝试在AppData-> npm-> ng.cmd中包含此“ --max_old_space_size = 8192”

当我尝试给出此命令时

node --max_old_space_size=2000  filename

我要发布的文件很多,但是此命令只允许一个文件。

如何解决此问题?

0 个答案:

没有答案