High CPU usage from Node.js when running vue-cli-service serve

Viewed 6344

The CPU usage by Node goes well over 100% when I run my npm script, which is using vue-cli-service serve. How can I debug this issue?

I'm working on a Mac, Node installed through nvm. Node version: 10.16, npm version: 6.9

3 Answers

Installing the fsevents module on MacOSX will help reduce the CPU usage.

npm install fsevents -g

npm rebuild fsevents

The problem was caused by the polling option.

Removing poll: true from the watchOptions in the webpack config - fixed the problem for me.

i use linux in virtualbox for dev purpose, and i have shared folder from windows host to linux guest. and my my vue project is stored in my hdd and shared with vbox.

so that i have to used {devServer: watchOptions: {poll: true}} in my vue.config.js for hot reload to works. this was causing the high cpu usage problem.

so i put my code in guest hdd and set poll:false and problem has gone.

hope someone find this helpfull.

Related