首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法运行nuxt项目-无法在中解析'fsevents‘

无法运行nuxt项目-无法在中解析'fsevents‘
EN

Stack Overflow用户
提问于 2021-03-12 00:00:20
回答 1查看 585关注 0票数 1

当我使用npm run dev运行我的nuxt.js项目时,我看到编译错误:

代码语言:javascript
复制
× Client
  Compiled with some errors in 12.53s


 WARN  Compiled with 2 warnings                                                                                                                                                                  friendly-errors 16:32:21  


 WARN  in ./node_modules/nodemon/lib/version.js                                                                                                                                                  friendly-errors 16:32:21  

Critical dependency: the request of a dependency is an expression                                                                                                                                friendly-errors 16:32:21  
                                                                                                                                                                                                 friendly-errors 16:32:21  

 WARN  in ./node_modules/chokidar/lib/fsevents-handler.js                                                                                                                                        friendly-errors 16:32:21  

Module not found: Error: Can't resolve 'fsevents' in 'C:\JDeveloper\mywork\Vue\my-project-fronted-test\node_modules\chokidar\lib'                                                              friendly-errors 16:32:21  
                                                                                                                                                                                                 friendly-errors 16:32:21  

 ERROR  Failed to compile with 13 errors                                                                                                                                                         friendly-errors 16:32:21  

These dependencies were not found:                                                                                                                                                               friendly-errors 16:32:21  
                                                                                                                                                                                                 friendly-errors 16:32:21  
* child_process in ./node_modules/nodemon/lib/version.js, ./node_modules/nodemon/lib/monitor/run.js and 1 other                                                                                  friendly-errors 16:32:21  
* fs in ./node_modules/chokidar/index.js, ./node_modules/chokidar/lib/fsevents-handler.js and 8 others                                                                                           friendly-errors 16:32:21  
                                                                                                                                                                                                 friendly-errors 16:32:21  
To install them, you can run: npm install --save child_process fs                                                                                                                                friendly-errors 16:32:21  
i Waiting for file changes                                                                                                                                                                                       16:32:21
i Memory usage: 449 MB (RSS: 633 MB)                                                                                                                                                                             16:32:21
i Listening on: http://localhost:8081/                                                                                                                                                                           16:32:21  

 WARN  Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\hiberfil.sys'                                                                                                                 16:32:22  

在浏览器中打开它后,我看到了许多这样的错误:

代码语言:javascript
复制
ERROR in ./node_modules/nodemon/lib/version.js
Module not found: Error: Can't resolve 'child_process' in 'C:\JDeveloper\mywork\Vue\my-project-fronted-test\node_modules\nodemon\lib'
ERROR in ./node_modules/nodemon/lib/spawn.js
Module not found: Error: Can't resolve 'child_process' in 'C:\JDeveloper\mywork\Vue\my-project-fronted-test\node_modules\nodemon\lib'
ERROR in ./node_modules/nodemon/lib/monitor/run.js
Module not found: Error: Can't resolve 'child_process' in 'C:\JDeveloper\mywork\Vue\my-project-fronted-test\node_modules\nodemon\lib\monitor'
ERROR in ./node_modules/pstree.remy/lib/index.js
Module not found: Error: Can't resolve 'child_process' in 'C:\JDeveloper\mywork\Vue\my-project-fronted-test\node_modules\pstree.remy\lib'
ERROR in ./node_modules/pstree.remy/lib/tree.js
Module not found: Error: Can't resolve 'child_process' in 'C:\JDeveloper\mywork\Vue\my-project-fronted-test\node_modules\pstree.remy\lib'
ERROR in ./node_modules/pstree.remy/lib/utils.js
Module not found: Error: Can't resolve 'child_process' in 'C:\JDeveloper\mywork\Vue\my-project-fronted-test\node_modules\pstree.remy\lib'
ERROR in ./node_modules/chokidar/index.js
Module not found: Error: Can't resolve 'fs' in 'C:\JDeveloper\mywork\Vue\my-project-fronted-test\node_modules\chokidar'

在删除node_modules文件夹和package-lock.json文件后,我尝试重新安装所有的软件包,但没有改变任何东西。这是我的package.json文件。

代码语言:javascript
复制
...
"author": "kojot",
  "private": true,
  "scripts": {
    "dev": "nuxt --port 8081",
    "dev:host": "nuxt --hostname 192.168.5.123 --port 8081",
    "build": "nuxt build",
    "start": "nuxt start",
    "generate": "nuxt generate",
    "export": "nuxt export",
    "serve": "nuxt serve"
  },
  "dependencies": {
    "@nuxtjs/auth": "^4.9.1",
    "@nuxtjs/axios": "^5.13.1",
    "@nuxtjs/proxy": "^1.3.3",
    "babel-polyfill": "^6.26.0",
    "cross-env": "^5.2.0",
    "element-ui": "^2.15.1",
    "lodash": "^4.17.21",
    "nuxt": "^2.15.3",
    "nuxt-i18n": "^6.21.0",
    "polish-plurals": "^1.1.0",
    "rsocket-core": "0.0.25",
    "rsocket-flowable": "0.0.25",
    "rsocket-websocket-client": "0.0.25",
    "uniqid": "^5.3.0",
    "vee-validate": "^3.4.5",
    "vue-cal": "^3.10.0",
    "vue-recaptcha": "^1.3.0",
    "vuex-map-fields": "^1.4.1"
  },
  "devDependencies": {
    "@nuxtjs/google-analytics": "^2.4.0",
    "@nuxtjs/moment": "^1.6.1",
    "@nuxtjs/vuetify": "^1.11.3",
    "nodemon": "^1.11.0"
  }
}

我使用的是Windows 10专业版和最新的node/npm版本:

代码语言:javascript
复制
OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.18363 N/A Build 18363

PS C:\> node -v
v14.16.0
PS C:\> npm -version
7.6.2

我能做些什么来运行这个项目?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-03-12 21:03:24

那么愚蠢的虫子..。我发现在我的一个vuex商店文件中,我有以下内容:

代码语言:javascript
复制
import {
  reset
} from "nodemon";

当然,它不是我写的,它是我在编写名为reset()的突变时由我的一些VSC插件添加的……编译错误是如此的毫无意义,以至于我花了2天的时间才找到这个bug。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66586086

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档