首页 > 解决方案 > 缺少依赖项详细调试信息nuxt.js编译错误

问题描述

我在我的 nuxt 2.14.4 应用程序上看到与此类似的依赖项错误。

ERROR  Failed to compile with 57 errors

These dependencies were not found:     
* child_process in ./node_modules/fsevents/node_modules/detect-libc/lib/detect-libc.js, ./node_modules/fsevents/node_modules/node-pre-gyp/lib/testbinary.js and 5 others
* fs in ./node_modules/chownr/chownr.js, ./node_modules/clone-stats/index.js and 48 others 
  1. 安装-重新安装“child_process”和“fs”并不能解决问题。显然,这是由其他东西触发的。
  2. 由于编译错误未出现在日志中,因此无法找到错误源。尝试了一些方法来扩展依赖项错误。“--loglevel 详细”和“nuxt-log”。但是日志并没有扩展依赖关系。我想查看所有缺少的依赖项(如日志所说,child_process 有 5 个,fs 有 48 个)来解决编译错误。
  3. 不确定这是否是对其他模块进行版本控制的问题。可以从2中算出来。
  4. 刷新/重新创建 node_modules 没有帮助。

来自日志截图附件的编译错误

标签: npmdependency-injectionnuxt.jsnode-modulesdependency-management

解决方案


推荐阅读