Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm gets killed or errno 137

I know there are already lots of questions about this problem, but I simply can´t believe I´m running out of memory.

npm run dev

> [email protected] dev /usr/www/users/****/****
> node build/dev-server.js

> Starting dev server...
ℹ 「wdm」: wait until bundle finished:
Killed
npm ERR! code ELIFECYCLE
npm ERR! errno 137
npm ERR! [email protected] dev: `node build/dev-server.js`
npm ERR! Exit status 137
npm ERR!
npm ERR! Failed at the [email protected] dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /usr/home/****/.npm/_logs/2018-11-11T02_31_12_055Z-debug.log

Running "free -g" return:

              total        used        free      shared  buff/cache   available
Mem:             31           1          18           0          10          28
Swap:             3           0           3

I can also post the debug log if that would help..

like image 484
jus_fabi Avatar asked Nov 11 '18 02:11

jus_fabi


People also ask

How do you fix npm err code Elifecycle npm Errno 1?

First, you need to run the npm cache clean --force command to clear the npm cache. The --force flag is required because npm will refuse to clear the cache without it. Next, you need to remove the package-lock. json and npm-shrinkwrap.

Why can't I npm install?

You need to make sure you have a package. json file right in the current directory where you run the command. Once you see there's a package. json file in the output as shown above, then you can run the npm install command.


1 Answers

This usually happens if OOM killer (https://linux-mm.org/OOM_Killer) ends a process due to RAM shortage. Can you post the output of free -m before running the build. I would suggest to have at least 512M RAM available when building the node.

like image 123
reza khademi Avatar answered Sep 22 '22 08:09

reza khademi