问题描述
说明
每次运行 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'
这个错误似乎是在我的 ./components/file.vue 中添加引导轮播后出现的。虽然我不明白 carroussel 是如何链接到 npm chokidar 包的。
我的尝试
此问题与 Error from chokidar (C:\): Error: EBUSY: resource busy or locked,lstat 'C:\DumpStack.log.tmp 重复,我尝试了建议的解决方案,但没有解决任何问题。我还按照错误代码的建议尝试了 npm install --save
以及 npm cache clean --force
。我已经卸载了 npm chokidar 包,但没有解决问题,并且也删除了 C:\DumpStack.log.tmp
文件。最后,我还安装了对 bug 没有影响的 bootstrap-vue npm 包。尽管我知道这可能是一个非常基本的错误,但以下内容均未解决该问题。
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"
]
}
我按照以下教程作为我想通过本网站实现的目标的参考框架:https://bezkoder.com/vue-node-express-mongodb-mevn-crud/
解决方法
如上所述,错误非常基本。我刚刚从 Bootstrap 复制粘贴了轮播模板,但忘记替换占位符。
抱歉打扰了,这可能有助于强调这样一个事实,即您确实必须在提出问题之前将问题联系起来,因为解决方案可能非常基本。
,