node.jsvue.jsnpmwebpackchokidar

vuejs - Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\hiberfil.sys'


Description

Everytime I run npm run serve the following error code appears:

ERROR  Failed to compile with 1 error                                                                     15:34:19

This dependency was not found:

* ... in ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifie
r":"1a1491e2-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./no
de_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Ho
me.vue?vue&type=template&id=8dc7cce2&

To install it, you can run: npm install --save ...
Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\hiberfil.sys'
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:\hiberfil.sys'
Error from chokidar (C:\node_modules): Error: EBUSY: resource busy or locked, lstat 'C:\hiberfil.sys'

This error seemed to arise after adding a bootstrap carousel in my ./components/file.vue. although I fail to understand how the carroussel is linked to the npm chokidar package.

What I've tried

This issue being a duplicate of Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\DumpStack.log.tmp, I tried the solutions suggested without solving anything. I also tried npm install --save as suggested by the error code as well as npm cache clean --force. I have uninstalled the npm chokidar package, which didn't solve the issue, and deleted the C:\DumpStack.log.tmp file too. Finally I also installed the bootstrap-vue npm package which had no effect on the bug. None of the following have solved the issue althought I am aware this probably a pretty basic error.

package.json

{
  "name": "vuejs-client",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
    "3": "^2.1.0",
    "axios": "^0.21.1",
    "bootstrap-vue": "^2.21.2",
    "chokidar": "^3.5.1",
    "core-js": "^3.6.5",
    "vue": "^2.6.11",
    "vue-router": "^3.5.1"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "~4.5.0",
    "@vue/cli-plugin-eslint": "~4.5.0",
    "@vue/cli-service": "~4.5.0",
    "babel-eslint": "^10.1.0",
    "eslint": "^6.7.2",
    "eslint-plugin-vue": "^6.2.2",
    "vue-template-compiler": "^2.6.11"
  },
  "eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "extends": [
      "plugin:vue/essential",
      "eslint:recommended"
    ],
    "parserOptions": {
      "parser": "babel-eslint"
    },
    "rules": {}
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not dead"
  ]
}

I followed the following tutorial as frame of reference for what I want to achieve with this website: https://bezkoder.com/vue-node-express-mongodb-mevn-crud/


Solution

  • Well as stated, the error was pretty basic. I just had copy pasted the template for the carousel from Bootstrap and forgotten to replace the placeholders.

    Sorry for the disturbances and may this help underline the fact that you really have to link the dots before asking the question as the solution can be quite basic.