npm install killed without a good error

2019-07-08 22:11发布

问题:

When I run

ng new new-app

to create an angular2 app, angular-cli creates the files and runs

npm install

The npm install is then killed without any error message. Almost all answers online pointed to a possible problem with running out of memory, so I upgraded my VPS from 512MB to 1GB of RAM.

It seems unlikely to me that a fresh Ubuntu 16.04 with 1GB RAM cannot npm install a standard angular2 app. Is there anything else I can try other than adding swap or ram?

Thanks!

回答1:

Adding RAM to the machine solved the problem (from 1GB to 2GB).

If someone else encounters the problem and cannot or doesn't want to add RAM, consider using yarn instead of npm.