/ node

Fix for 100% CPU usage by node.js

I was seeing a really high spike in CPU usage while running projects which used node.js, in most cases the CPU usage was way above 100%.

This issue can be really intimidating when you have watchers which watch for file changes, like for eg: webpack.

As usual, my google-fu landed in a couple of Github issues where users mentioned the same problems.

Whats the fix.?

TL;DR install/re-install fsevents

  • Install fsevents if you are using MacOS and have not already installed it
npm install fsevents
  • Rebuild if you had installed fsevents but recently upgraded node version.
npm rebuild fsevents

Hope this helps someone. :spock_hands:



Manu S Ajith

Manu S Ajith

Tech Entrepreneur, dating Elixir, in long-term ❤️ w/ Ruby, had multiple one night stands w/ Go. Into functional paradigms DDD/CQRS/EventSourcing architecture these days. @manusajith on the interwebs

Read More