Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
"npm search" runs out of memory and dies without good error #3867
On my Ubuntu virtual machine with 256Mb ram + 4Gb swap, npmjs 0.10.x:
WARN Building the local index for the first time, please be patient
When I bump the memory on the virtual machine to 512Mb or higher, it works perfectly. There are no permission issues, and this is still an issue with the latest version from git. I've decided to just give my vm 512Mb, but this is an issue that should at least be documented.
I should have added that
Hit this too on a 512 MB VM,
Not a huge deal to grab a fresh copy from an identical system that has more ram, as @bhyde suggests.
Another (sort of dangerous) option is to pop another terminal, find the PID in /proc as root and disable the OOM killer for that process (will thrash like crazy, but should work), or background the initial
Needs to be done as root, but will prevent the kernel from touching the process when it goes on its serial killer rampage looking for victims as memory is eaten up.
At your own risk, of course :)
Just a note here to ping people with small-memory VMs - I have a candidate replacement for
While building the index, total memory usage peaks at 750MB-1000MB, but the medium-term goal would be to build the index file centrally and distribute that. When I run the search on a previously-built index, max RSS usage is 180MB for a full table scan, ~50-80MB for an indexed lookup.
Please give it a try!
I am still having the same issue. For me, it fails with and without
node: v5.3.0, npm: 3.3.12
node: v4.2.3, npm: 2.14.7
OpenVZ VPS config