5

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/

Adrien Brown
  • 61
  • 1
  • 1
  • 6

3 Answers3

1

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.

Adrien Brown
  • 61
  • 1
  • 1
  • 6
0

Try this solution: Error: EBUSY: resource busy or locked, rmdir

  • Thank you very much for your help but I am unsure which program to target because I'm only running npm run serve. The most useful answer lead me to closing down the nodejs programs running which as you might've guessed had no effect. I also uninstalled my malware but it didn't have an effect. – Adrien Brown Apr 03 '21 at 17:17
  • Did you run "npm install" before? – Sergio Carvalho Apr 03 '21 at 20:00
  • Yes I just retried all of the things mentioned above while doing `npm install` before and afterwards. – Adrien Brown Apr 03 '21 at 21:33
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 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 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.

UPDATE: I think the solution to this problem is don't install json-server globally. Install it locally and use npx json-server --watch to watch. Otherwise a globally installed json-server will watch the entire drive through that app. That's why I had to copy the code into a new app uninstall json-server globally and reinstall it locally .

David Agabi
  • 43
  • 1
  • 8
  • 1
    This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](https://stackoverflow.com/questions/ask). To get notified when this question gets new answers, you can [follow this question](https://meta.stackexchange.com/q/345661). Once you have enough [reputation](https://stackoverflow.com/help/whats-reputation), you can also [add a bounty](https://stackoverflow.com/help/privileges/set-bounties) to draw more attention to this question. - [From Review](/review/late-answers/29967749) – Sterex Oct 01 '21 at 20:57
  • 1
    It doesn't answer it technically, but it is a viable solution if all else fails. It's been posted many times in different places and the solutions are different and don't pin down the problem either. So, I thought it would be wise to write my full story so people can keep all the solutions in mind as well as the last resort. – David Agabi Oct 01 '21 at 21:23