2016-10-18 2 views
6

Beim Ausführen npm install -g ionic ich folgende Fehlermeldung erhalten:npm installieren - JavaScript-Heap aus dem Speicher

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

Gibt es eine Möglichkeit, das node.js Speicherlimit erhöht global?

+0

Können Sie uns sagen, welche OS Sie verwenden und welche Version Knoten und npm ist? – paolord

+0

Windows 10, Knoten v6.8.1, npm v3.10.8 – gunwin

+0

Mögliches Duplikat von [FATAL ERROR: CALL \ _AND \ _RETRY \ _LAST Zuweisung fehlgeschlagen - Prozess nicht genügend Arbeitsspeicher] (https://stackoverflow.com/questions/26094420/fatal -Fehler-call-and-Retry-last-Allocation-failed-Prozess-out-of-memory) –

Antwort

6

Sie können NPM starten mit:

node --max_old_space_size=8000 /usr/bin/npm install -g ionic

Wie here beschrieben, ist der Standardwert ist 4000 (4 GB).

+1

Knoten starten können Sie auch starten: 'node --max_old_space_size = 8000 $ (welche npm) installiert -g ionic' –

2

Versuchen Sie, node --max-old-space-size=<size> wo Größe in Megabyte ist.

+0

Wie Sie einen Knoten Option kann beim laufen npm – Jay

+0

installieren @Jayraj npm durch – xShirase

0

ich dies als Duplikat markiert, aber falls jemand geschieht über sie, ich gepostet die moderne Lösung für dieses Problem bei https://stackoverflow.com/a/48895989/4200039 über:

As of v8.0 shipped August 2017, the NODE_OPTIONS environment variable exposes this configuration (see NODE_OPTIONS has landed in 8.x!). Per the article, only options whitelisted in the source are permitted, which includes "--max_old_space_size".

So I put in my .bashrc: export NODE_OPTIONS=--max_old_space_size=4096