Yarn Slow In Windows? Disable Windows Defender

Last updated: February 9, 2017

I switched to Yarn a while ago, because Npm is incredibly limited. And while I enjoy fast speed on macOs and Linux, Windows has always been a bit slow.

I never actually thought to investigate the issue until one frustrated evening, I had the task manager open and noticed Windows Defender was going crazy when I was doing a yarn install on a pulled down SPA app.

Turns out disabling Windows Defender halved the amount of time it took to not only resolve dependencies but link them from the local cache.

Disabling Windows Defender is half the battle, though. As disabling it via the Windows Defender settings panel only does so temporarily.

The real fix is to actually a couple of Node.js folders to the Windows Defender exclusions list. You can do this via the settings panel.

The Node.js folder is located at: c:\Program Files\nodejs and lastly the npm global folder is at: c:\Users\YourUserName\AppData\Roaming\npm

Ignore both of these folders and you will see Yarn speed up dramatically.

I guess the downside of the Node ecosystem being comprised of tens of thousands of files spells doom when antivirus and malware scanning software gets in the way.

Now I wonder, what else was Windows Defender slowing down?




4 thoughts on “Yarn Slow In Windows? Disable Windows Defender

  1. It looks like it’s not working anymore. Since my last Windows update Yarn is extremely slow. I have tried to disable Windows Defender completely and it’s still very slow.

  2. You can also exclude processes from Windows Defender So excluding node.exe I guess will be fine

Leave a Reply

Your email address will not be published. Required fields are marked *