关于vue中因为版本冲突安装没有效果,问题总结
1.关于安装了vue3中element-ui的安装已经改为npm install --save element-plus了,就需要导入对应的css样式,引入了element-plus的样式报错。--save-dev时报错,并且在node_modules文件中没有找到。解决办法就是使用如下命令安装此版本的router。4.安装npm install。
1.关于安装了vue3中element-ui的安装已经改为npm install --save element-plus了,就需要导入对应的css样式,引入了element-plus的样式报错
怎么解决呢,只需要改一下样式,如下:
import 'element-plus/theme-chalk/index.css'
2.关于在安装 npm i element-ui -S 报错对应信息怎么解决:
npm i element-ui -S
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: vue@3.2.47
npm ERR! node_modules/vue
npm ERR! peer vue@"3.2.47" from @vue/server-renderer@3.2.47
npm ERR! node_modules/@vue/server-renderer
npm ERR! @vue/server-renderer@"3.2.47" from vue@3.2.47
npm ERR! peer vue@"^3.2.0" from vue-router@4.1.6
npm ERR! node_modules/vue-router
npm ERR! vue-router@"^4.1.6" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! element-ui@"*" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: vue@2.7.14
npm ERR! node_modules/vue
npm ERR! peer vue@"^2.5.17" from element-ui@2.15.13
npm ERR! node_modules/element-ui
npm ERR! element-ui@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/naitang/.npm/eresolve-report.txt for a full report.
就是因为安装element-ui出现的版本冲突问题,使用如下命令就可以解决此问题:
npm i element-ui -S -legacy-peer-deps
3.安装cnpm install sass-loader --save-dev 成功啦,但是在运行时出错了,说明是sass的版本过高,这个时候你需要,重新安装一下sass,当然需要把之前的sass删除掉,具体操作如下:
卸载 npm uninstall sass-loader
安装 npm install sass-loader@7.3.1 --save-dev
如果在运行还报错,把lang="sass"去掉也就是如下图:
4.安装npm install vue-router --save-dev时报错,并且在node_modules文件中没有找到
ERR! this command with --force, or --Tegacy-peer-deps
ERR!to accept an incorrect (and potentially broken) dependency resolution
ERR!
ERR!See C;\Users\gwx13\AppData\Local\npm-cacheleresolve-report.txt for a full report.
ERR!A complete log of this run can be found in:
ERR!
ERR !While resolving: vue-project-first@1.0.0
ERR!
Found: vue@2.6.14
ERR!node modules vue
ERR !
vue@"^2.5.2" from the root project
ERR!
ERR!Could not resolve dependency:
ERR!
peer vue@"^3.2.0" from vue-router@4.0.13
pm
om
ERR!node modules/vue-router
ERR!
dev vue-router@"*" from the root project
解决办法就是使用如下命令安装此版本的router
npm install --legacy-peer-deps vue-router@3.5.2
-
关于在安装npm install vuex --save报错如下信息怎么解决:
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: demo-vue@1.0.0
npm ERR! Found: vue@2.7.14
npm ERR! node_modules/vue
npm ERR! vue@"^2.5.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vue@"^3.2.0" from vuex@4.1.0
npm ERR! node_modules/vuex
npm ERR! vuex@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
Z-debug.log
PS F:\vue\demo-vue> npm i vuex --legacy-peer-deps
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: 'nopt@6.0.0',
npm WARN EBADENGINE required: { node: '^12.13.0 || ^14.15.0 || >=16.0.0' },
npm WARN EBADENGINE current: { node: 'v15.8.0', npm: '7.5.1' }
npm WARN EBADENGINE }
这是因为版本问题,运行如下命令就可以解决此问题:
npm i vuex@3
但是您需要注意你在使用vue版本,需要安装您所需要的vuex版本
vue2对应vuex@3 vue3对应vuex@4
希望您学习愉快
更多推荐



所有评论(0)