添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
千杯不醉的小刀  ·  Angular UI - atob ...·  2 月前    · 
谈吐大方的盒饭  ·  How to call java ...·  3 周前    · 
爱吹牛的牙膏  ·  iOS ...·  10 月前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

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

Ask Question

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'
                I had something similar and it was because someone had added an npm package and I hadn't npm install after pulling their changes.
– stubbzarelli
                Jul 29, 2020 at 12:27
                Why is npm/chokidar/whatever trying to do anything with my swapfile anyways? That's... rather alarming.
– Paul
                Aug 26, 2020 at 19:55
                @MelvinKoopmans chokidar is a file-watcher and there's no good reason for anything to be watching root-directory files, let alone system files like those. All the answers blaming VS Code have it wrong, something appears to be screwy with chokidar if you ask me. (I get this running things like webpack serve from the command line, no editors involved -- but as many answers state, it seems to be a side-effect of other errors.)
– McGuireV10
                Jan 15, 2021 at 9:51

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;

To caveat on this post; I ran into Error from chokidar (C:): Error: EBUSY: resource busy or locked, lstat 'something.sys' and it was because I allowed VSCode to import a package for me. So if you allowed VSCode to import something for you, go back and check your imports. All of them. -- Thanks! – Jason Jun 13, 2020 at 14:49 Thanks! In my case there was a HTML style comment were left behind after HTML was updated to pug. – Zugor Nov 20, 2020 at 1:56

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

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

I had this same error at a React project and missing dependency from package.json was the reason. – Enes Kirimi Dec 17, 2020 at 10:07 What about if this happens right after creating a new vue js project and installing 2 dependencies and 2 plugins via the vue ui? It is completly local and still throws this error right after fresh setup and installation of sass-loader, node-sass, vuex and vue-router. I cant seem to find an answer. – BrOsCoRe Feb 19, 2021 at 14:52

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
                This worked for me, the higher-ranked answers were addressing specific modules that I wasn't using.
– johnbr
                Jun 25, 2021 at 12:31

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
                Also if you updated core-js from v2 to v3 and still have imports in the v2 format in your polyfills file.
– rooby
                Feb 18, 2021 at 6:56

While using @Output(), remove auto imported statement

import { EventEmitter } from 'protractor';

and include import EventEmitter from existing

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

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.

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

npm i

Thanks!

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!

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

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 !

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

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"
                Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
– Community
                Dec 28, 2021 at 12:36

The root cause of this is a directory that does not exist being passed to chokidar. Run 'node ls chokidar' to get a list of packages you are using that use chokidar, then double check any paths you are setting in any config files that might be being used by these packages. In my case it was due to me setting the static option for webpack-dev-server to '/public' rather than path.join(__dirname, 'public') in my webpack config.

After looking into it further if you pass a path that doesn't exist to chokidar it will look down the path and start watching the first directory it finds that exists. In the case where that is C:/ then these EBUSY errors will occur against system protected files found there.

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 [email protected]

for yarn:

yarn add [email protected]
  • 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'

    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.

    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';
    
    import { FirebaseCrudService } from '../../firebase/crud/firebase-crud.service';
    

    and it worked.

    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.

    to be on safe side you can use ng build --prod in pre-push hook in package.json as "husky": {"hooks":{"pre-push": "ng build --prod"}}, – Analyst Sep 2, 2021 at 5:22

    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
    

    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.

    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!

    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.

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

    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.

    This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. To get notified when this question gets new answers, you can follow this question. Once you have enough reputation, you can also add a bounty to draw more attention to this question. - From Review – Sumit Sharma May 27, 2022 at 12:17