Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Allocation failed - process out of memory while npm install

I have installed nodejs and npm in my aws server and there were no issues. But when I tried to install bower, I got a memory allocation error. I was able to fix it by disabling the progress bar by

sudo npm set progress=false

But i'm getting

Allocation failed - process out of memory error

on npm install. I tried npm cache clean, but the same error exists.

like image 987
Vineeth Vijayan Avatar asked Feb 17 '16 12:02

Vineeth Vijayan


People also ask

How do I fix a process out of memory exception in node JS?

This exception can be solved by increasing the default memory allocated to our program to the required memory by using the following command. Parameters: SPACE_REQD: Pass the increased memory space (in Megabytes).

Why npm install is not working?

The Npm command not found error can appear when you install or upgrade npm. On Windows, the cause of this error could be that a PATH or system variable is not correctly set. The error can also occur if you do not have npm or Node. js installed, have an outdated version, or have permission issues.

How much memory does npm install need?

Please reserve at least 6 GB for OS resources and npm On-Site appliance containers. Once installed, you can configure where registry data is stored on your server via the "Storage" paths on the "Settings" page of the admin web console (port 8800).


1 Answers

The issue here appears to be pretty self explanatory, Node is running out of memory. I have previously ran into this issue on a machine with only 600MB of ram, I'd suggest increasing the instance size to something with over 1GB of RAM and trying again.

like image 84
J0sh0nat0r Avatar answered Sep 23 '22 20:09

J0sh0nat0r