You run npm install, the progress bar crawls, and then nothing seems to move for ten, twenty, or even forty minutes. Your terminal looks alive, but no new packages appear and your project folder stays empty. This is a common frustration, especially on a first project.
A stuck install rarely means your computer is broken. Usually a slow network setting, antivirus scan, damaged cache, or one heavy package is holding up the process. This guide walks through the causes in order, starting with the fastest fixes.
Quick Answer
npm install gets stuck on Windows most often because of a slow or blocked network connection, antivirus software scanning every package file, a corrupted npm cache, or an outdated npm version. Stop the install with Ctrl + C, clear the cache with npm cache clean --force, temporarily pause real-time antivirus scanning, and run the install again with npm install --verbose so you can see exactly where it slows down.
What npm Is Actually Doing While You Wait
When you type npm install, npm does much more than download a few files. Understanding these steps helps you spot which stage is stuck.
First, npm reads package.json and package-lock.json and builds a dependency tree, often with hundreds of packages. Second, it contacts the registry to fetch each package — a slow connection, DNS, proxy, or firewall slows this stage badly. Third, it extracts packages into node_modules, which can mean 30,000 small files, each potentially checked by Windows antivirus as it is written.
Step 1: Check Whether It Is Really Stuck
Large projects can legitimately take five to ten minutes on a first install, especially on a mechanical hard drive or a slow laptop. Before you cancel, check for signs of life.
- Look at the spinning character or progress output in the terminal. If it is still moving, npm is still working.
- Open Task Manager and check CPU and network use for the Node.js process. Steady activity usually means progress, even if the screen looks quiet.
- Watch the size of the
node_modulesfolder in File Explorer. If it keeps growing, the install is moving. - If nothing has changed for more than 15 minutes and CPU and network use are both at zero, the install is almost certainly stuck and you can safely stop it with
Ctrl + C.
Step 2: Run the Install With Verbose Logging
Run the install in a way that shows exactly what npm is doing.
- Open a new terminal in your project folder.
- Run
npm install --verbose. - Watch the last lines on screen. They tell you whether npm is fetching from the network, extracting files, or waiting on a package install script.
- If the log stops on a
GETrequest to the registry, your problem is network related. If it stops during extraction, suspect antivirus or disk issues. If it stops on one package name, that package is the likely culprit.
The official guidance in the npm install command documentation on docs.npmjs.com explains the flags and behaviour of the installer in detail, and it is worth bookmarking if you work with Node projects every day.
Step 3: Fix Network, Registry, and Proxy Problems
Test the registry connection
Run npm ping. This simple command contacts the npm registry and reports how long the reply took. If the ping fails or takes several seconds, npm is struggling to reach the internet. Try a different network, restart your router, or disconnect a VPN and test again. Corporate and college networks sometimes block or slow the registry, and a mobile hotspot is a quick way to confirm whether the network is the problem.
Check your registry setting
Run npm config get registry. The normal answer is https://registry.npmjs.org/. If a tutorial or an old job once set a slow mirror or a company registry that no longer exists, every install will wait on timeouts. Reset it with npm config set registry https://registry.npmjs.org/ and try again.
Remove a broken proxy
If you once used a proxy at work or school, npm may still be trying to use it at home. Run npm config get proxy and npm config get https-proxy. If either shows an address you no longer use, clear it with npm config delete proxy and npm config delete https-proxy.
Step 4: Clear a Corrupted npm Cache
npm stores every downloaded package in a local cache so repeat installs are fast. If that cache becomes damaged — for example after a cancelled install, a crash, or a full disk — later installs can stall while npm tries to use broken data.
- Run
npm cache verifyto check the health of the cache and remove garbage entries. - If verification reports errors, run
npm cache clean --forceto empty the cache completely. - Delete the half-finished
node_modulesfolder and thepackage-lock.jsonfile only if the lock file itself is damaged, then runnpm installagain.
Clearing the cache means the next install downloads everything fresh, so it may be slower once, but it removes one of the most common hidden causes of a freeze. Our step-by-step guide to clearing the npm cache safely on Windows covers each command and explains when you should and should not delete the lock file.
Step 5: Stop Antivirus and Windows Defender From Scanning Every File
This is the single biggest Windows-specific slowdown. Real-time protection scans each of the thousands of small files npm writes. You do not need to turn off your protection permanently. Instead, add a folder exclusion for your development folder.
- Open Windows Security and go to Virus and threat protection settings.
- Find the Exclusions section and choose Add an exclusion, then Folder.
- Select the parent folder where you keep your projects, for example
C:\devor your main projects folder. - Run
npm installagain and compare the time.
Keep projects outside constantly syncing folders such as OneDrive. A sync tool uploading 30,000 new files while npm writes them creates a traffic jam. Moving the project to C:\dev\my-project fixes this surprisingly often.
Step 6: Update Node.js and npm
Very old npm versions had known performance problems. Check yours with node -v and npm -v, and update npm with npm install -g npm@latest if it is far behind.
If you switch Node versions often, consider using a version manager for Windows so old installs do not pile up. Also avoid installing from a nearly full disk, because npm needs temporary space to extract packages.
Step 7: Deal With One Heavy or Broken Package
Sometimes the whole install is fine except for one package. The verbose log usually names it. Common offenders are packages that compile native code, download large binaries, or rely on old install scripts.
- Search the package name with the word install to see if other Windows users report the same hang.
- Check whether the package needs extra tools, such as Python or Visual Studio Build Tools, and install them if your project truly requires that package.
- Try installing the suspect package on its own with
npm install package-name --verboseto confirm it is the cause. - If the package is optional, remove it from
package.json, complete the install, and find a maintained alternative. - Run
npm install --ignore-scriptsas a test only. If the install finishes instantly with scripts disabled, an install script was the problem. Note that some packages genuinely need their scripts, so treat this as a diagnostic step, not a permanent settings change.
Common Mistakes and Useful Tips
- Deleting node_modules over and over without changing anything. If you repeat the exact same install, you will usually get the exact same hang. Change one thing at a time — cache, network, or antivirus — so you learn what fixed it.
- Running several installs at once. Two npm processes writing to the same project will fight each other and both may appear stuck. Use one terminal per project.
- Installing inside a synced or very deep folder path. Long Windows paths and cloud sync both slow extraction badly. Keep project paths short and local.
- Ignoring the verbose log. Guessing leads to random fixes. Two minutes of logging tells you the exact stage that is failing.
- Tip: use a wired connection for the first big install. After the cache is warm, later installs on Wi-Fi are much quicker.
Conclusion
A stuck npm install on Windows is almost never a mystery once you look in the right order. Confirm it is truly stuck, use verbose logging to find the slow stage, fix network and registry settings, clear a damaged cache, and remove the antivirus and sync-folder bottlenecks that make Windows installs uniquely slow. Work through those steps one at a time and most installs that seemed frozen for half an hour will finish in a few minutes — and stay fast on every project after that.
Frequently Asked Questions
How long should npm install normally take?
A small project should finish in under a minute, and a large React or full-stack project usually takes two to ten minutes on a first install. Anything beyond 15 minutes with no CPU or network activity is a sign of a real problem.
Is it safe to stop npm install with Ctrl + C?
Yes. Stopping an install does not damage your code. You may be left with a partial node_modules folder, which you can delete before running the install again for a clean result.
Will clearing the npm cache delete my project?
No. The cache is separate from your project files. Clearing it only removes downloaded package copies stored by npm, so the next install downloads fresh copies from the registry.
Why is npm install slower on Windows than on Mac or Linux?
Windows real-time antivirus scanning checks the thousands of small files npm creates, and Windows file handling for very large numbers of tiny files is slower in general. Folder exclusions for your development directory reduce the gap a lot.
Should I switch to pnpm or Yarn to fix slow installs?
They can be faster, but switch because you prefer the tool, not as a first fix — a broken network, proxy, or cache will slow down any package manager.


[…] If the version conflict is only one of several install headaches on your machine, our broader guide to fixing npm install problems on Windows covers the network, cache, and antivirus causes that can strike at the same […]