Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 445 Vote(s) - 3.6 Average
  • 1
  • 2
  • 3
  • 4
  • 5
'npm install' extremely slow on Windows

#11
Fully turning off virus and firewall protection isn't the safest option. While it makes things faster, it leaves you more vulnerable.

In my case, I only excluded the node.exe process in virus & threat protection.

- In your start menu, type "windows security" and open the app.
- Click on "Virus & threat protection"
- Virus & threat protection settings => Manage settings
- Exclusions => Add or remove exclusions
- Add an exclusion => process => type node.exe => click Add

just a simple create-react-app went down from 2m40s to 1m10s
npm commands are also executed by node.exe, so the same improvements are noticed there.
Reply

#12
Make sure you really are using a recent version of npm. In my case `C:\Program Files\nodejs\npm.cmd` had been using an old `npm-cli.js` below the default `prefix` folder `%appdata%\npm` rather than a newer `npm-cli.js` below `C:\Program Files\nodejs`.

Setting the [environment variable][1] `npm_config_prefix` to `C:\Program Files\nodejs` solved that. (Before finding that solution, I tried using the `--prefix` [argument][2] and found out the hard way doing so _"[forces non-global commands to run in the specified folder][3]"_.)

I found a huge performance increase going from 3.10.9 to 6.13.4-- enough to make `npm install` times acceptable despite interference from antivirus.


[1]:

[To see links please register here]

[2]:

[To see links please register here]

[3]:

[To see links please register here]

Reply

#13
I just went through a rabbit hole trying to identify the issue. If npm install keeps getting bottlenecked you should heavily consider modifying the properties of your virtual ethernet and disable all of the **offload** items.

I had 0 proxies or caching issues with npm.

See here for the tutorial on how to get to the menu and disable your offload settings. Make sure you do this for both your your ethernet and VEthernet and you should immediately notice a difference. I went from a 10 minute hanging resolution that sometimes just stopped down to 10 seconds installs.

[To see links please register here]

Reply

#14
In my case it was due to over 200 vulnerabilities. When I ran

npm audit fix

that solved only just a few of them. Eventually, I had to run

npm audit fix --force

and it got way better than before.
Reply

#15
in addition to all other great comments, I'd also suggest switching to yarn (

[To see links please register here]

).
using devops (selfhosted agent v.2.192.0), with node (v.14.17.6), we were able to trim total build (install + build) from ~10min to ~6-7 min.
Reply

#16
**Warning regarding security: this is an insecure approach if you don't use any other means of antivirus protection.**

From eternity → to **5 seconds builds**:


- search for ***Windows Defender settings***
- → Virus & threat protection
- → Virus & threat protection Settings
- → Exclusions

here add this two paths to your list of excluded *realtime protection* folders:

```text
C:\Program Files\nodejs
C:\Users\<your username>\AppData\Roaming\npm
```

**PS**: replace the `<your username>` with your respective *User* folder name; or use [alias to the *AppData* folder][1] like: `%AppData%\npm`
If you're wondering why you can't find the *AppData* folder in Explorer, make sure to check *"View"* options for *"Show hidden folders"*.


[1]:

[To see links please register here]

Reply

#17
This is highly situational but we have a local registry (`npm config get registry`) that was not available (VPN:d) in when I was running the `npm install ...` and this obviously made it very slow but it still succeeded because everything was still available through cache.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through