描述
每次运行npm run serve
时都会出现以下错误代码:
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'
在我的 ./components/file.vue 中添加引导轮播后,似乎出现了这个错误。虽然我不明白 carroussel 是如何与 npm chokidar 包相关联的。
我试过的
此问题与来自 chokidar (C:\) 的错误重复:错误:EBUSY:资源繁忙或锁定,lstat 'C:\DumpStack.log.tmp,我尝试了建议的解决方案,但没有解决任何问题。我也npm install --save
按照错误代码以及npm cache clean --force
. 我已经卸载了 npm chokidar 包,它没有解决问题,并且也删除了该C:\DumpStack.log.tmp
文件。最后,我还安装了对 bug 没有影响的 bootstrap-vue npm 包。尽管我知道这可能是一个非常基本的错误,但以下都没有解决这个问题。
包.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"
]
}
我按照以下教程作为我想通过这个网站实现的参考框架:https ://bezkoder.com/vue-node-express-mongodb-mevn-crud/