2016-11-14 2 views
2

node.js 7이 설치되어 있습니다. 내가 램 32GB의이NPM의 메모리가 부족합니다.

$ npm search mongo npm WARN Building the local index for the first time, please be patient [..................] | : WARN Building the local index for the first time, please be patient <--- Last few GCs ---> 

[12455:0x23175c0] 73384 ms: Mark-sweep 1038.6 (1354.9) -> 1032.1 (1351.0) MB, 808.4/0.0 ms allocation failure GC in old space requested [12455:0x23175c0] 74196 ms: Mark-sweep 1032.1 (1351.0) -> 
1031.9 (1314.0) MB, 811.6/0.0 ms last resort gc [12455:0x23175c0] 75024 ms: Mark-sweep 1031.9 (1314.0) -> 1031.9 (1307.0) MB, 828.2/
0.0 ms last resort gc 


<--- JS stacktrace ---> 

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

Security context: 0x1301816c0d11 <JS Object> 
    1: fromString(aka fromString) [buffer.js:217] [pc=0xd2afa68dcae](this=0x130181604311 <undefined>,string=0x2c89d250c589 <Very long string[216148348]>,encoding=0x1301816c9921 <String[4]: utf8>) 
    2: from [buffer.js:114] [pc=0xd2afa691090](this=0x12c0d1a860b1 <JS Function Buffer (SharedFunctionInfo 0x1301816e2009)>,value=0x2c89d250c589 <Very long string[216148348]>,encodingOrOffset=0x1301816... 

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory 1: node::Abort() [npm] 2: 0xf4e4cc [npm] 3: v8::Utils::ReportOOMFailure(char const*, bool) [npm] 4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [npm] 5: v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [npm] 6: v8::internal::String::SlowFlatten(v8::internal::Handle<v8::internal::ConsString>, v8::internal::PretenureFlag) [npm] 7: v8::internal::String::Flatten(v8::internal::Handle<v8::internal::String>, v8::internal::PretenureFlag) [npm] 8: v8::String::WriteUtf8(char*, int, int*, int) const [npm] 9: node::StringBytes::Write(v8::Isolate*, char*, unsigned long, v8::Local<v8::Value>, node::encoding, int*) [npm] 10: node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) [npm] 11: node::Buffer::CreateFromString(v8::FunctionCallbackInfo<v8::Value> const&) [npm] 12: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) [npm] 13: 0x7f1698 [npm] 14: 0x7f1a30 [npm] 15: v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) [npm] 16: 0xd2afa1063a7 Annullato (core dump creato) 

: 이 오류가! 어떻게 해결할 수 있습니까 ??

+0

NPM의 최신 버전을 사용하고 있습니까? - https://github.com/npm/npm/issues/12619 –

+0

안녕하세요! 나는 버전 3.10.9를 사용하고있다! – matteo

+0

이 작동합니다 : $ node --max-old-space-size = 2048/usr/bin/npm search mongo – matteo

답변

1

귀하의 npm 버전이 오래된 것 같습니다. 단지 npm upgrade -g을 npm에서 v4.x로 업데이트하면 모두 설정해야합니다.

0

대신 $ node --max-old-space-size=8192 $(which npm) search mongo을 사용해보세요 !!

관련 문제