vue ui没反应及npm i -g @vue/cli报错问题完美解决!

本文介绍了解决在命令行环境下使用Vue CLI时遇到的UI组件安装失败的问题。通过分析错误信息,发现安装失败的原因在于目标目录已存在同名文件。最终采用带有--force选项的命令成功安装了UI组件,并验证了其可用性。

1.起因

命令行需使用vue ui,但该命令无效。因为没有ui组件。

2.npm i -g @vue/cli报错

经查询,需要通过npm i -g @vue/cli安装ui组件。但该命令执行过程中报错。

3.分析

看报错原因,应该是安装目录已存在同名文件。提示移除已存在的文件或者重试(已重试多次无效),或者命令行中带 --force 去覆盖已有文件。显然覆盖是比较方便稳妥的,万一删错了。。

npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

4.解决

使用npm i -g @vue/cli --force命令,不再报错,可执行成功

5.验证

vue命令下能看到ui组件

vue ui启动ui组件成功,自动弹出浏览器项目界面

 

怎么在vunpm install -D css-loader npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: iscp-app-erm-ui@0.1.0 npm ERR! Found: css-loader@3.6.0 npm ERR! node_modules/css-loader npm ERR! css-loader@"^3.5.3" from @vue/cli-service@4.5.5 npm ERR! node_modules/@vue/cli-service npm ERR! peer @vue/cli-service@"^3.0.0 || ^4.0.0-0" from @aurora/vue-cli-plugin-aurora-eslint@1.0.12 npm ERR! node_modules/@aurora/vue-cli-plugin-aurora-eslint npm ERR! dev @aurora/vue-cli-plugin-aurora-eslint@"latest" from the root project npm ERR! peer @vue/cli-service@"^3.0.0 || ^4.0.0-0" from @vue/cli-plugin-babel@4.5.5 npm ERR! node_modules/@vue/cli-plugin-babel npm ERR! dev @vue/cli-plugin-babel@"^4.5.0" from the root project npm ERR! 5 more (@vue/cli-plugin-eslint, @vue/cli-plugin-router, ...) npm ERR! peer css-loader@"*" from vue-loader@15.11.1 npm ERR! node_modules/vue-loader npm ERR! vue-loader@"^15.9.2" from @vue/cli-service@4.5.5 npm ERR! node_modules/@vue/cli-service npm ERR! peer @vue/cli-service@"^3.0.0 || ^4.0.0-0" from @aurora/vue-cli-plugin-aurora-eslint@1.0.12 npm ERR! node_modules/@aurora/vue-cli-plugin-aurora-eslint npm ERR! dev @aurora/vue-cli-plugin-aurora-eslint@"latest" from the root project npm ERR! 6 more (@vue/cli-plugin-babel, @vue/cli-plugin-eslint, ...) npm ERR! 1 more (the root project) npm ERR! npm ERR! Could not resolve dependency: npm ERR! dev css-loader@"*" from the root project npm ERR! npm ERR! Conflicting peer dependency: webpack@5.99.9 npm ERR! node_modules/webpack npm ERR! peer webpack@"^5.0.0" from css-loader@6.9.1 npm ERR! node_modules/css-loader npm ERR! dev css-loader@"*" 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 C:\Users\lwx1453525\AppData\Local\npm-cache\eresolve-report.txt for a full report. 报错e.config.js中配置,需要安装那些依赖
最新发布
09-11
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值