`npm install` ends with "Killed"
Solution 1
I am running into a similar issue installing npm packages and getting the message "Killed" and a non-zero exit status. For my scenario, it was because my system was running out of memory and I had no swap configured. Configuring swap fixed my problem.
Solution 2
I haved same problem, my solution:
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
sudo /sbin/mkswap /var/swap.1
sudo /sbin/swapon /var/swap.1
this commands changed configuration for swap
Solution 3
To solve this issue on 14.04 and 16.04:
sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo swapon --show
sudo cp /etc/fstab /etc/fstab.bak
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
sudo sysctl vm.swappiness=10
echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf
sudo sysctl vm.vfs_cache_pressure=50
echo 'vm.vfs_cache_pressure=50' | sudo tee -a /etc/sysctl.conf
This will create a swap file of 1GB
Solution 4
Trying running npm install cross-spawn
and then npm install
again to see if that works. It looks like whats happening is when you run npm install npm looks inside your package.json provided by telesope and is running a deprecated package
Solution 5
I got the same issue when running npm run build
in a VM with a single core CPU and 1GB RAM. Increasing the RAM to 4GB resolved this issue.
Related videos on Youtube
kramer65
Updated on July 09, 2022Comments
-
kramer65 almost 2 years
I'm trying to run Telescope (a meteor app) on an Ubuntu 16.04 server. I follow the instructions in the readme:
curl https://install.meteor.com/ | sh git clone [email protected]:TelescopeJS/Telescope.git npm install
The first two commands run without an error, but the last command end in
Killed
:$ npm install npm WARN deprecated [email protected]: cross-spawn no longer requires a build toolchain, use it instead! extract:moment → gunzTarP ▐ ╢█████████████████████████████████████████████████░░░░░░░░░░╟ Killed
Since it doesn't give any information I'm unsure what could be wrong here. Does anybody know how I can solve this? All tips are welcome!
[EDIT] Using the tip of @Mills in the comments I first ran
npm install cross-spawn
and thennpm install
again. This fixed thenpm install
issue, but when I now try to run the app usingmeteor
it ends with "Killed" again:$ meteor Killednloading [email protected]_4... |
Any more ideas?
-
M1lls almost 8 yearslooks like cross-spawn-async is deprecated try npmjs.com/package/cross-spawn instead
-
kramer65 almost 8 years@Mills - I'm not very familiar with npm. Could you explain a bit more on how I can do that?
-
M1lls almost 8 yearstrying running
npm install cross-spawn
and thennpm install
again to see if that works. It looks like whats happening is when you run npm install npm looks inside your package.json provided by telesope and is running a deprecated package -
kramer65 almost 8 yearsIt did indeed solve that issue. Thanks for that. But when I now try to run the app using
meteor
, it ends in "Killed" again. Any ideas? -
M1lls almost 8 yearsWhat did the error message say before it gave you the "killed" output? Looks to me like opening an issue on the telescope repo might be best because the build process shouldn't be this broken.
-
-
sankargorthi over 7 yearsI was running a vagrant box with default settings (512MB in RAM). Adding 2 cpus and 1024MB RAM fixed this for me.
-
kujiy over 6 yearsI limited the resource of my docker container. Unreal. Adding
memswap_limit
fixed the problem. Thanks. -
Eugene Wang almost 6 yearsThank you so much, it worked for me. I use the Digital Ocean minimum server ( 512 MB ) and this solution worked for me.
-
Adiii almost 6 yearsfacing the same issue in docker just reduce container memory and its works
-
shiva over 5 yearsfree -m total used free shared buff/cache available Mem: 7938 4968 278 92 2690 2594 Swap: 5119 2 5117 after this i have run npm install command but i got sudo npm install npm WARN deprecated [email protected]: Use ngx-filter-pipe instead. npm WARN deprecated [email protected]: Typings is deprecated in favor of NPM @types -- see README for more information Killed ............] / fetchMetadata: sill mapToRegistry uri registry.npmjs.org/webpack-subresource-integrity
-
Yuriy Korman over 5 yearsHello Shiva! Please post your package.json
-
Admin over 5 yearsThat's not going to work in some situations. Some Node modules include binary components which may be system-dependent. (For an obvious example:
node_modules
from a Linux system will not be portable to Windows, and vice versa.) -
Sugam Malviya over 5 yearsThank you so much, In t2.nano AWS EC2 configuration it worked.
-
zakaria amine about 5 yearsI followed this digitalocean.com/community/tutorials/… for setting swap on ubuntu, although it seems a bit old. So far so good.
-
Mostafa Soufi almost 5 yearsWorked for me. Thank you. 👍🏻
-
AtAFork about 4 years@zakariaamine this DigitalOcean article is the updated version (for Ubuntu 18.04) of the article you linked to
-
Aaron Miller almost 4 yearsPerfect. Worked for my Ubuntu LTS 18.4 on AWS Lighsail. Thanks!
-
VityaSchel almost 3 yearsWhat if I only have 512 mb of ram on server?
-
wlarcheveque over 2 yearsAlso, node_modules is a gargantuan folder of thousands of files, this transfer would not be very fast.
-
oschvr about 2 yearsThank you worked for Ubuntu 18.04 on EC2 !