• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

I Like Kill Nerds

The blog of Australian Front End / Aurelia Javascript Developer & brewing aficionado Dwayne Charrington // Aurelia.io Core Team member.

  • Home
  • Aurelia 2
  • Aurelia 1
  • About
  • Aurelia 2 Consulting/Freelance Work

Yarn Slow In Windows? Disable Windows Defender

Front End Development · February 3, 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?

Dwayne

Leave a Reply Cancel reply

7 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Balder
Balder
6 years ago

It works. How to exclude folders in Windows Defender for Windows 10:

https://support.microsoft.com/en-us/instantanswers/64495205-6ddb-4da1-8534-1aeaf64c0af8/add-an-exclusion-to-windows-defender

0
zewa666
zewa666
6 years ago

Great tip, I’d update the article with Balders comment, thx for that 😉

0
Balder
Balder
6 years ago

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.

0
Nico Wernli
Nico Wernli
4 years ago

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

0
Gregg B. Jensen
Gregg B. Jensen
3 years ago

Thank you, I tried things from several different blogs, and this is the only one that worked. In our case it was a server in Azure with Windows Defender.

0
Nope
Nope
2 years ago

Nice, thank you!

0
Bubba Rodgers
Bubba Rodgers
1 year ago

Yeah right. Those working in a corporate environment can’t do a thing about it.

0

Primary Sidebar

Popular

  • Testing Event Listeners In Jest (Without Using A Library)
  • How To Get The Hash of A File In Node.js
  • Thoughts on the Flipper Zero
  • Waiting for an Element to Exist With JavaScript
  • How To Paginate An Array In Javascript
  • Handling Errors with the Fetch API
  • ChatGPT Stopping Part Way Through a Response? Here Is How You Fix It
  • How To Get Last 4 Digits of A Credit Card Number in Javascript
  • How to Use Neural DSP Archetype Plugins With the Quad Cortex
  • How To Mock uuid In Jest

Recent Comments

  • CJ on Microsoft Modern Wireless Headset Review
  • Dwayne on Microsoft Modern Wireless Headset Review
  • CJ on Microsoft Modern Wireless Headset Review
  • john on Microsoft Modern Wireless Headset Review
  • Dwayne on Why You Should Be Using globalThis Instead of Window In Your Javascript Code

Copyright © 2023 · Dwayne Charrington · Log in

wpDiscuz