Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

angular

Using Angular and during ng serve, I'm getting the error:

Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\DumpStack.log.tmp' Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\hiberfil.sys' Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\pagefile.sys' Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\swapfile.sys' 
like image 713
Post Impatica Avatar asked May 21 '20 13:05

Post Impatica


2 Answers

I get this whenever I'm using VSCode and I add something similar to a component:

@Output() somename = new EventEmitter(); 

...and I let VSCode auto-import the supporting module. Instead of adding EventEmitter to the existing @angular/core, VSCode adds a new import to protractor which causes the error.

If you are getting this error and can't remember where the last changes were made, try searching for from 'protractor' in your code;

like image 109
Post Impatica Avatar answered Oct 02 '22 14:10

Post Impatica


This can happen after several different build errors. For some reason the build summary fails to report the original error and reports this instead.

(Incidentally I see the OP was using Angular and ng serve; I'm getting this in React using npm start. So I'm guessing it could happen in VS Code using any toolchain.)

I was getting this output in the VS Code terminal:

i 「wdm」: Failed to compile. Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\hiberfil.sys' Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\pagefile.sys' Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\swapfile.sys' 

After looking for answers on this page and elsewhere, I found nothing that worked for me.

But when I scrolled back in the VS Code terminal, I found this build error:

ERROR in ./Components/ServiceBooking/ServiceBooking/ServiceBooking.tsx Module not found: Error: Can't resolve 'components/Common/BookingComponents/BookingTypeSelector/BookingTypeSelector' in [...] 

That was a casing error in an import auto-added by VS Code. I don't know why but VS Code does that sometimes. Maybe there is something we can tweak in this project to help VS Code not to do that. Anyway, it was an error, and once I fixed it by changing "components" to "Components" in the import, the secondary errors about hiberfil.sys, pagefile.sys and swapfile.sys went away.

The moral of the tale: beware of the build summary masking build errors. Any time you hit a weird build error, first scroll back through the detailed build output to make sure you are chasing the right error (the original error, rather than a secondary error like this one).

like image 38
Reg Edit Avatar answered Oct 02 '22 14:10

Reg Edit