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
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).
Please reserve at least 6 GB for OS resources and npm On-Site appliance containers.
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.
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.
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)
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With