我正在尝试发布一个 npm 包。但是在给出命令时我收到了这个错误npm publish
。
JS 堆栈跟踪
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
我有很多文件要发布,但这个命令只允许一个文件。
如何解决这个问题?