Encountering Fatal Memory Allocation Error During npm Search

After installing NodeJS and npm on Windows, executing npm search (e.g. npm find lodash) triggers a fatal memory error with extensive GC logging.

PS C:\Users\User> npm find lodash
npm WARN Setting up package cache...
[===-------] Indexing modules...
Error: Memory allocation failure

How can this issue be fixed?

hey, try updatin your node and npm make sure they match. you can run node with --max_old_space_size=4096 to see if that helps. i had a simmilar issue and that did the trick.