gpt4 book ai didi

node.js - 由于 Node js 内存不足,NPM 命令显示中止消息

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

我是nodejs新手,当我使用npm命令时,我收到以下错误

 $ npm install express --save
Error: ENOMEM: not enough memory, scandir '/home/buraqtechno'

<--- Last few GCs --->
[32765:0x23f0eb0] 216 ms: Mark-sweep 6.3 (14.8) -> 6.3 (14.8) MB, 7.7 / 0.0 ms (average mu = 0.025, current mu = 0.025) allocation failure GC in old space requested[32765:0x23f0eb0] 225 ms: Mark-sweep 6.3 (14.8) - > 6.2 (11.3) MB, 8.4 / 0.0 ms (average mu = 0.018, current mu = 0.011) last resort GC in old space requested
[32765:0x23f0eb0] 232 ms: Mark-sweep 6.2 (11.3) -> 6.2 (11.3) MB, 7.5 / 0.0 ms (average mu = 0.010, current mu = 0.003) last resort GC in old space requested

<--- JS stacktrace --->
==== JS stack trace =========================================

0: ExitFrame [pc: 0x36dbe9d841bd]
1: StubFrame [pc: 0x36dbea085ad7]
Security context: 0xb670dc1e6c9 <JSObject>
2: emitWarning(aka emitWarning) [0x2f6470520629] [internal/process/promises.js:50] [bytecode=0x39e2a436f581 offset=22](this=0x2f9cf48822e1 <undefined>,uid=1,reason=0x2f9cf48ba979 <TypeError map = 0x11c2cc49951>)
3: emitPromiseRejectionWarnings(aka emitPromiseRejectionWarnings) [0x2f647051fe31] [internal/process/pr...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: 0x89c2f0 node::Abort() [npm]
2: 0x89c33c [npm]
3: 0xa8f05e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [npm]
4: 0xa8f278 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [npm]
5: 0xe7cad2 [npm]
6: 0xe8bd46 v8::internal::Heap::AllocateRawWithRetry(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [npm]
7: 0xe543fb v8::internal::Factory::NewFixedArrayWithFiller(v8::internal::Heap::RootListIndex, int, v8::internal::Object*, v8::internal::PretenureFlag) [npm]
8: 0xe64b09 v8::internal::Factory::SetNumberStringCache(v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::String>) [npm]
9: 0xe64ba9 v8::internal::Factory::NumberToString(v8::internal::Handle<v8::internal::Object>, bool) [npm]
10: 0xf6ed72 [npm]
11: 0xf6f7e7 v8::internal::JSStackFrame::ToString() [npm]
12: 0xf71f68 v8::internal::ErrorUtils::FormatStackTrace(v8::internal::Isolate*, v8::internal::Handle<v8::internal::JSObject>, v8::internal::Handle<v8::internal::Object>) [npm]
13: 0xa88587 v8::internal::Accessors::ErrorStackGetter(v8::Local<v8::Name>, v8::PropertyCallbackInfo<v8::Value> const&) [npm]
14: 0xf7587d v8::internal::PropertyCallbackArguments::BasicCallNamedGetterCallback(void (*)(v8::Local<v8::Name>, v8::PropertyCallbackInfo<v8::Value> const&), v8::internal::Handle<v8::internal::Name>, v8::internal::Handle<v8::internal::Object>) [npm]
15: 0xfa9231 v8::internal::Object::GetPropertyWithAccessor(v8::internal::LookupIterator*) [npm]
16: 0xfa5430 v8::internal::Object::GetProperty(v8::internal::LookupIterator*) [npm]
17: 0xeedd50 v8::internal::LoadIC::Load(v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Name>) [npm]
18: 0xef0fb7 v8::internal::Runtime_LoadIC_Miss(int, v8::internal::Object**, v8::internal::Isolate*) [npm]
19: 0x36dbe9d841bd
Aborted

当我检查两者的版本时,它正在工作

$ npm -v
6.1.0

$ node -v
v10.6.0

请帮助我,我已经遇到问题两天了。在此之前它正在工作

最佳答案

首先检查你的系统中是否全局安装了nodejs和npm。如果没有,如果你的操作系统是ubuntu,请使用下面的链接进行安装。 https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-16-04

关于node.js - 由于 Node js 内存不足,NPM 命令显示中止消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51220530/

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