1.关于安装了vue3中elementui的安装已经改为npm installsave elementplus了,就需要导入对应的css样式引入了elementplus样式报错

怎么解决呢,只需要改一下样式如下

import 'element-plus/theme-chalk/index.css'

2.关于在安装 npm i elementui -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 sassloadersavedev 成功啦,但是在运行出错了,说明sass版本过高,这个时候需要重新安装一下sass,当然需要把之前的sass删除掉,具体操作如下

卸载 npm uninstall sass-loader
安装 npm install sass-loader@7.3.1 --save-dev

如果在运行还报错,把lang=”sass去掉也就是如下图

4.安装npm install vueroutersavedev时报错,并且在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;Usersgwx13AppDataLocalnpm-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
  1. 关于在安装npm install vuexsave报错如下信息怎么解决

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:vuedemo-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

希望您学习愉快

原文地址:https://blog.csdn.net/weixin_61189391/article/details/129388664

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任

如若转载,请注明出处:http://www.7code.cn/show_30660.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注