0

Every time when i run or restart my backend server, it shows following error in my terminal:

Error from chokidar (C:\node_modules): Error: EBUSY: resource busy or locked, lstat 'C:\hiberfil.sys' Error from chokidar (C:\node_modules): Error: EBUSY: resource busy or locked, lstat 'C:\pagefile.sys'
Error from chokidar (C:\node_modules): Error: EBUSY: resource busy or locked, lstat 'C:\swapfile.sys' Error from chokidar (C:\node_modules): Error: EBUSY: resource busy or locked, lstat 'C:\DumpStack.log.tmp'

My tech stack is: Nodejs, MongoDb, Mongoose, React, NPM, Material-ui If you still want to add me any code or file, let me know

Its pretty annoying, How can i eliminate this error?

Safin Ghoghabori
  • 516
  • 1
  • 6
  • 17
  • 1
    Does this answer your question? https://github.com/paulmillr/chokidar/issues/1037 – dako Apr 05 '21 at 10:26
  • @ZdravkoPernikov no it doesn't answer my question. It would be better if someone elaborate on it. – Safin Ghoghabori Apr 05 '21 at 10:35
  • Does this answer your question? [Error from chokidar (C:\‌): Error: EBUSY: resource busy or locked, lstat 'C:\DumpStack.log.tmp](https://stackoverflow.com/questions/61936085/error-from-chokidar-c-error-ebusy-resource-busy-or-locked-lstat-c-dump) – Sinan Yaman Apr 05 '21 at 11:17
  • @SinanYaman its for Angular and totally strange solutions are there, I'm asking for MERN stack specifically Nodejs – Safin Ghoghabori Apr 06 '21 at 12:32

3 Answers3

0

Try this to solve your problem: 1- Delete node_modules folder. 2-run npm install . 3-run npm cache clean .

  • It solved when i restarted my server but then when i came after restarting whole system i.e. my laptop, it shows same errors again. – Safin Ghoghabori Apr 05 '21 at 12:46
0

This problem happened to me after installing JSON-SERVER globally and watching the server. I'm not sure if that was the cause but it happened right after the watching started.

I aborted the watch and the app wouldn't load with npm run serve.

I tried everything suggested by every forum post I could find including deleting node_modules folder and package.json, npm install, cache clean, cache clean --force, resetting my computer, disabling anti-virus and I have no malware software installed.

The only thing that finally worked was creating a whole new project and copying and pasting the files from the old corrupt one into a new one. I also had to run npm install again so all the dependencies could be installed.

I don't understand why JSON Server should have anything to do with the cause unless the watching locks folders and renders the app unrunnable.

I will try again after I make a few copies of my app to experiment on because copying and pasting files is not a fun job unless your project is small enough.

David Agabi
  • 43
  • 1
  • 8
0
 sudo sysctl -w fs.inotify.max_user_watches=524288

Just run this command in (Ubuntu/Debian). It works fine for me.