Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

super slow node npm commands

Tags:

I have node v.4.4 with npm v.2.14.20 (default bundled with windows installer). My OS: Windows 7 64bit. Hardware: Dell laptop, 16GB RAM, SSD, core i7.

I'm facing a problem with extremely slow npm. For example when I want to check version of node with

node --version v4.4.0 

I receive output 4.4.0 within miliseconds. But when I type

npm --version 

I need to wait ridiculous 8-15 seconds to receive an output! And it's the same with every single npm command.

What i tried: update npm (to most recent 3.x version), update node to 5.9.0, i also tried my luck with x86 versions - same thing.

  1. Any clues what can cause such "sleep" (it's only with npm, every other cmd command works fine, system works fine)?
  2. I will appreciate any tips how I can debug this thing to see what's going on under the hood
like image 544
Mic Avatar asked Mar 19 '16 19:03

Mic


People also ask

Why does npm start slow?

If you find that npm is running slow and it isn't your computer or internet, it is most likely because of a severely outdated version.

Why is my node so slow?

Node. js programs can be slow due to a CPU/IO-bound operation, such as a database query or slow API call. For most Node. js applications, data fetching is done via an API request and a response is returned.

Why is node so slow on Windows?

Node. js programs can be slow due to CPU or IO bound operations. On the CPU side, typically there is a “hot path” (a code that is visited often) that is not optimized. On the IO side, limits imposed by either the underlying OS or Node itself may be at fault.


1 Answers

I had similar problems regarding npm being slow. Ive researched for hours on possible solutions. The only solutions that worked for me was either disabling the progress bar with npm config set progress false --global Or using a different terminal such as git bash or windows terminal.

like image 158
Josh Merlino Avatar answered Oct 22 '22 23:10

Josh Merlino