Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NPM Search: Running out of memory

On ubuntu 14.10 (3.13.0-76-generic #120-Ubuntu SMP Mon Jan 18 15:59:10 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux), when I do:

sudo npm search yeoman-generator

I get the following error:

npm WARN Building the local index for the first time, please be patient

FATAL ERROR: CALL_AND_RETRY_2 Allocation failed - process out of memory

NPM Version is 3.7.1

Please help

like image 741
Romaan Avatar asked Feb 10 '16 03:02

Romaan


People also ask

How do I fix a process out of memory exception error 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).

How much memory does NPM install need?

Please reserve at least 6 GB for OS resources and npm On-Site appliance containers.

How do I stop JavaScript heap out of memory?

To fix JavaScript heap out of memory error, you need to add the --max-old-space-size option when running your npm command. Alternatively, you can also set the memory limit for your entire environment using a configuration file.

How do I increase my node memory limit?

If you want to increase the max memory for Node you can use --max_old_space_size option. You should set this with NODE_OPTIONS environment variable.


2 Answers

According to npm's bug tracker, this has been fixed in [email protected]. (see thread).

Searching works fine for me after upgrading npm:

npm install npm@latest -g

(you might need to su/sudo on your system)

like image 22
David Tang Avatar answered Oct 13 '22 16:10

David Tang


While not a solution, per say, I typically do my searches on http://npmjs.org

Even when it works, npm search is epically slow due to the size of the index. I would recommend avoiding it unless you have no available browser.

See the canonical NPM search doesn't work issue: https://github.com/npm/npm/issues/6016

like image 102
Kevin Burdett Avatar answered Oct 13 '22 15:10

Kevin Burdett