Vue报错:This dependency was not found: vuex in ./node_modules/babel-loader/lib

Posted 流楚丶格念

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Vue报错:This dependency was not found: vuex in ./node_modules/babel-loader/lib相关的知识,希望对你有一定的参考价值。

报错

This dependency was not found:
* /components/Lianxi.vue in ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/App.vue
To install it, you can run: npm install --save /components/Lianxi.vue

原因&解决

1. 可能存在问题是 安装的vuex出现问题

解决方法:
根据提示再次安装 vuex,执行

npm install --save vuex

再不行那就是vuex的版本问题,vuex4不匹配vue2

详细查看下面博文:https://blog.csdn.net/weixin_45525272/article/details/124961685

2. 文件路径引入出现错误:

检查提示的路径,看看路径是否有问题

3. 代码写错了,例如:引入时候vuex后多打了一个空格

删除后就可以正确运行

以上是关于Vue报错:This dependency was not found: vuex in ./node_modules/babel-loader/lib的主要内容,如果未能解决你的问题,请参考以下文章

Vue err:This dependency was not found

This dependency was not found

TipsVue项目报错:This dependency was not found:* regenerator-runtime/runtime.js in ./node_modules/cache(代

vue项目切换分支后This dependency was not found解决办法

vue项目切换分支后This dependency was not found解决办法

vue项目切换分支后This dependency was not found解决办法