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

Angular

Angular Problem Overview


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'

Angular Solutions


Solution 1 - Angular

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;

Solution 2 - Angular

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).

Solution 3 - Angular

check for the missing dependencies in package.json

I am using vue js  I was trying to run a project and I had this error this problem was because the other developer used a global dependencies and it was not included in my node_modules folder

Solution 4 - Angular

Just write npm install , it is a file viewer that warns that a dependency is not properly updated. Without reading the hidden comment among the thousands I would never have known

Solution:

npm install

Solution 5 - Angular

Follow these steps:

  1. Delete the "node_modules" folder
  2. Run npm install
  3. Run npm cache clean

Solution 6 - Angular

If you are using polyfills, this error will occur if you activated the following polyfill (from src/polyfills.ts):

/** IE10 and IE11 requires the following for NgClass support on SVG elements */
import 'classlist.js';  // Run `npm install --save classlist.js`.

...and did not run the corresponding npm install:

npm install --save classlist.js

Solution 7 - Angular

Had this in VueJs (2) - installed a module, then uninstalled it (npm uninstall <module_name>) and forgot to delete the "import <module_name>" from the .vue file. Silly but there it was.

Solution 8 - Angular

While using @Output(), remove auto imported statement

import { EventEmitter } from 'protractor';

and include import EventEmitter from existing

import { Component, OnInit,EventEmitter } from '@angular/core';

Solution 9 - Angular

EventEmitter() by default imported by protractor in VS code,

import { EventEmitter } from 'protractor'; remove this and import from core.

import { EventEmitter } from '@angular/core';

this solves the other issue as well which is expecting 0 arguments and have 1.

Solution 10 - Angular

I had the same issue and I fixed via setting in package.json

"browser": {
  "http": false
}

How to insert in package.json

{
  "name": "App Name",
  "version": "0.0.0",
  "scripts": {
     // --------
  },
  "dependencies": {
     // --------
  },
  "devDependencies": {
     // --------
  },
  "browser": {
    "http": false
  }
}

If someone knows its reason that why is it necessary and what happens by adding this then please add some description to make reading more sensible. Thanks

Solution 11 - Angular

I had the same error because phpStorm/WebStorm added this import

import {forEach} from 'ag-grid-community/dist/lib/utils/array';

just remove it and the problem was gone!

Solution 12 - Angular

I had the same issue. My colleague had installed this dependency and I simply restored packages (right click on package.json - Restore Packages) in packages.json and it seemed to fix it.

Solution 13 - Angular

I got similar issue when building an ionic application. I had some similar pages and components from other application reused in this one. Once running, I receveived the message[ng] Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\pagefile.sys. This was solved by installing a missing library. The error was presented on vscode terminal, a little bit above the message presented on the screen. I felt silly because the error was there since the beginning and I haven´t realized I should have search for it.

Solution 14 - Angular

Yes, I also had a same error..
enter image description here

SOLUTION

It means there's some packages are not installed in your node_module. so just run this command.

npm install  

And then serve again your project !

Solution 15 - Angular

In my case, I was facing the same issue. What I guess is, this arises due to circular dependency. I used a service that was injected in multiple components and I was retrieving all that components simultaneously. It was throwing error resource busy.... I resolved it by providing service in root instead of multiple lazy loaded modules. May be helpful for someone

Solution 16 - Angular

I had the same issue today and am using VueJS 3 and VS Code. Somehow my @vue/cli-service was downgraded from 4.5.0 to 3.5.3. No idea how that happened. Anyway, by updating package.json with the following and running npm install after that, it was solved.

"@vue/cli-service": "^4.5.13"

Solution 17 - Angular

In my case, the problem was randomly added import by VS CODE auto-complete. So search for the dependency and remove if it is not in use.

Solution 18 - Angular

I needed to re-install the npm packages that were showing later in the error logs (in my case bootstrap and react-router-dom)

Solution 19 - Angular

For Vue.js, Check if you have import like this import Vue from "*.vue"; change it to import Vue from "vue"; It was auto imported by VsCode

Solution 20 - Angular

This bug is related to Babel and it's preset, I know the screenshot is related to NuxtJS but this npm command solves the problem for Angular as well, since they are using almost the same configuration.

for npm:

npm i -S core-js@2.5.7

for yarn:

yarn add core-js@2.5.7


                                                                                                           
  • core-js/core/dict in ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./pages/index.vue?vue&type=script&lang=js&

To install it, you can run: npm install --save core-js/core/dict

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

enter image description here

Solution 21 - Angular

I got this error while using angular multi-project setup. I was using firebase functions in my project. The cause of my issue was having a source file located under "projects/my-project/src/app/*" import another file located under "projects/my-project/functions/src*". The functions folder was a sub project folder and had it's own "node_modules" folder.

SOLUTION

So I searched for all import references under "projects/my-project/functions/src*" containing "/functions/". I was using Web Storm but most modern IDE's and text editors like vscode have this capability.

Solution 22 - Angular

I had the same issue, and my resolution was to change absolute path when including components (added automatically by VS Code), to relative path, and issue gone.

Changed from:

import { FirebaseCrudService } from 'app/src/firebase/crud/firebase-crud.service';

to:

import { FirebaseCrudService } from '../../firebase/crud/firebase-crud.service';

and it worked.

Solution 23 - Angular

In my case this errors were totally unrelated to chokidar. The build has failed because someone did a commit with errors and before even trying to compile i ran "ng serve" I couldn't see the errors.

Either scroll up to see the errors or make a "ng build" before serving so you can see what to fix.

Solution 24 - Angular

The solution for me: There's a problem with 2 developers installing dependencies in project using npm and yarn. I use yarn, so:

rm package-lock.json //deleting the package-lock.json  
rm -rf node_modules //deleting the node_modules
yarn //installing the dependencies with yarn
yarn cache clean //cleaning the cache
yarn serve //run the project

Solution 25 - Angular

I got this error while install Material UI designs in my react project, and after installing npm package i have no issues now.

Add:

npm i

Thanks!

Solution 26 - Angular

In Linux this type of errors happen when chokidar doesn't get enought file watchers from the system. Thus, increasing then in the system (or reduce the number of files whatched on the project) solves the problem.

The question here is how to do this on Windows.

Solution 27 - Angular

I had a similar problem with my cypress runner. I was getting the following error:

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

What happened was that VS automatically put a line on top of my code that read:

const { each } = require("cypress/types/bluebird")

I just removed it from my code and it worked fine. Hope that will help a lot of y'all!

Solution 28 - Angular

Vue/Nuxt.js

I got this same error in vue/nuxt js application, it happened because of mix package manager that leads to unsynchronized lock files, it is advised not to mix package manager in order to avoid resolution inconsistencies caused by unsynchronized lock files.

enter image description here

enter image description here

Solution: Delete node_modules folder and use npm/yarn depending upon what you used to generate lock file

Solution 29 - Angular

It happened to me when I imported the MatSlideToggle class from:

import {MatSlideToggle} from '@angular/material/slide-toggle/slide-toggle'; 

instead of import it from:

import {MatSlideToggle} from '@angular/material/slide-toggle';

I changed it and now everything works well.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionPost ImpaticaView Question on Stackoverflow
Solution 1 - AngularPost ImpaticaView Answer on Stackoverflow
Solution 2 - AngularReg EditView Answer on Stackoverflow
Solution 3 - AngularNashaat MohamedView Answer on Stackoverflow
Solution 4 - AngularEzequiel MiceliView Answer on Stackoverflow
Solution 5 - AngularChristopher RichardsonView Answer on Stackoverflow
Solution 6 - AngularMartin ÅhlinView Answer on Stackoverflow
Solution 7 - AngularGreg BurmanView Answer on Stackoverflow
Solution 8 - AngularAntonyView Answer on Stackoverflow
Solution 9 - AngularShivaram TolanurView Answer on Stackoverflow
Solution 10 - AngularWasiFView Answer on Stackoverflow
Solution 11 - AngularChristophe Le BesneraisView Answer on Stackoverflow
Solution 12 - AngularRobgit28View Answer on Stackoverflow
Solution 13 - AngularLuizView Answer on Stackoverflow
Solution 14 - AngularRohit TagadiyaView Answer on Stackoverflow
Solution 15 - AngularAnalystView Answer on Stackoverflow
Solution 16 - AngularEugeneView Answer on Stackoverflow
Solution 17 - Angularomer faruk kalkanView Answer on Stackoverflow
Solution 18 - AngularPatricia HeimfarthView Answer on Stackoverflow
Solution 19 - AngularPranoy SarkarView Answer on Stackoverflow
Solution 20 - AngularAli.GhodratView Answer on Stackoverflow
Solution 21 - AngularA JohnsonView Answer on Stackoverflow
Solution 22 - AngulardzonaView Answer on Stackoverflow
Solution 23 - AngularRuben MiquelinoView Answer on Stackoverflow
Solution 24 - AngularEdinho RodriguesView Answer on Stackoverflow
Solution 25 - AngularGopalakrishnan TView Answer on Stackoverflow
Solution 26 - AngularvanderdillView Answer on Stackoverflow
Solution 27 - AngularITselectView Answer on Stackoverflow
Solution 28 - AngularAnurag TripathiView Answer on Stackoverflow
Solution 29 - AngularAvraham WeinsteinView Answer on Stackoverflow