【问题标题】:Old Node_modules folder causing build errors导致构建错误的旧 Node_modules 文件夹
【发布时间】:2019-11-14 13:17:35
【问题描述】:

以前我在尝试将 vue 更新到最新版本时遇到问题,所以我将我的 node_modules 文件夹重命名为 node_modules_OLD 并安装了 npm。这创建了一个新的 node_modules 文件夹并将所有内容更新到最新版本。那里没问题,除了显然我应该完全删除 node_modules 文件夹,因为现在当我尝试运行 npm run build 时,出现以下错误:

 ERROR  Failed to compile with 1 errors                                                                                                                     14:56:27

This relative module was not found:

* ../../node_modules_OLD/postcss-selector-parser/postcss-selector-parser in ./node_modules/vuetify-loader/lib/loader.js!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/faculty.vue?vue&type=script&lang=js&
 ERROR  Build failed with errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1

我已经删除了 node_modules_OLD 文件夹,但在查找 node_modules_OLD 时仍然遇到同样的错误。我还完全删除了 node_modules 文件夹并再次运行 npm install,它创建了 node_modules 文件夹,但它仍然在 npm run build 上抛出相同的错误。

为什么要查看 node_modules_OLD 文件夹?我怎样才能让它停止寻找它?删除 node_modules_OLD 文件夹似乎没有帮助。

【问题讨论】:

    标签: vue.js vuetify.js vue-cli


    【解决方案1】:

    您可以尝试删除文件package-lock.json,文件夹node_modules并重新运行npm install

    【讨论】:

      猜你喜欢
      • 2016-12-09
      • 2016-05-24
      • 2021-03-21
      • 2017-12-14
      • 2017-07-11
      • 1970-01-01
      • 2018-03-27
      • 2013-01-14
      • 2021-02-13
      相关资源
      最近更新 更多