[英]“Error in ./node_modules/fsevents/fsevents.node” in Vue-CLI project
今天在我的 Argon Vue.js 項目中遇到了一個問題。 當我嘗試運行“npm run serve”命令時,我收到以下錯誤消息:
錯誤無法編譯,出現 1 個錯誤 15:36:11 錯誤 in./node_modules/fsevents/fsevents.node
我的 webpack.config.js 文件:
let service = process.VUE_CLI_SERVICE
if (!service || process.env.VUE_CLI_API_MODE) {
const Service = require('./lib/Service')
service = new Service(process.env.VUE_CLI_CONTEXT || process.cwd())
service.init(process.env.VUE_CLI_MODE || process.env.NODE_ENV)
}
module.exports = service.resolveWebpackConfig()
我的 package.json 文件:
{
"name": "vue-argon-design-system",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"bindings": "^1.5.0",
"bootstrap-vue": "^2.0.4",
"flatpickr": "^4.5.1",
"jquery": "^3.5.1",
"module": "^1.2.5",
"node-sass": "^4.14.1",
"nouislider": "^11.1.0",
"register-service-worker": "^1.5.2",
"vue": "^2.6.6",
"vue-flatpickr-component": "^8.1.1",
"vue-lazyload": "^1.2.6",
"vue-router": "^3.0.2",
"vue2-transitions": "^0.2.3"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.4.0",
"@vue/cli-plugin-eslint": "^3.4.0",
"@vue/cli-plugin-pwa": "^3.4.0",
"@vue/cli-service": "^3.4.0",
"fsevents": "^2.1.3",
"node-loader": "^1.0.1",
"sass-loader": "^7.3.1",
"vue-template-compiler": "^2.6.6",
"webpack": "^4.44.2"
}
}
完整的錯誤信息:
ERROR Failed to compile with 1 errors 16:12:36
error in ./node_modules/fsevents/fsevents.node
Module parse failed: Unexpected character '�' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)
@ ./node_modules/fsevents/fsevents.js 13:15-41
@ ./node_modules/chokidar/lib/fsevents-handler.js
@ ./node_modules/chokidar/index.js
@ ./node_modules/watchpack/lib/chokidar.js
@ ./node_modules/watchpack/lib/DirectoryWatcher.js
@ ./node_modules/watchpack/lib/watcherManager.js
@ ./node_modules/watchpack/lib/watchpack.js
@ (webpack)/lib/node/NodeWatchFileSystem.js
@ (webpack)/lib/node/NodeEnvironmentPlugin.js
@ (webpack)/lib/webpack.js
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://192.168.1.151:8082/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
盡管進行了研究,但我仍然無法解決這個問題。 有人對我有提議嗎? 先感謝您。
它還沒有准備好直接修復這個錯誤。 開發人員應在庫中修復此錯誤。 您可以使用-f
或--force key
來安裝所有依賴項 force 而不會發出任何警告。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.