安装npm install -g @vue/cl需注意 @vue/cli 4.5.15

本文介绍了解决使用npm安装@vue/cli过程中遇到的问题的方法。包括推荐使用淘宝镜像来避免安装过程中可能出现的各种错误,并提供了详细的步骤指导。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

目前版本

在这里插入图片描述

使用

npm install -g @vue/cli

出错,能用,后面会不断有不同类型的错误。比如
安装npm i less less-loader --save

建议 使用淘宝镜像

先清除原来的

npm uninstall -g @vue/cli
>npm uninstall -g @vue/cli

安装淘宝

npm install -g cnpm --registry=https://registry.npm.taobao.org
在这里插入图片描述

查看淘宝镜像

cnpm -v
在这里插入图片描述

安装

cnpm install -g @vue/cli

在这里插入图片描述

查看安装文件(大写V)

vue -V
在这里插入图片描述

现在npm install 报错 F:\008717hz\houtai>npm install npm error code ERESOLVE npm error ERESOLVE could not resolve npm error npm error While resolving: @vue/cli-plugin-eslint@4.5.15 npm error Found: eslint@8.4.1 npm error node_modules/eslint npm error dev eslint@"8.4.1" from the root project npm error peer eslint@"^7.5.0 || ^8.0.0" from @babel/eslint-parser@7.16.5 npm error node_modules/@babel/eslint-parser npm error dev @babel/eslint-parser@"7.16.5" from the root project npm error 3 more (eslint-plugin-vue, eslint-utils, vue-eslint-parser) npm error npm error Could not resolve dependency: npm error peer eslint@">= 1.6.0 < 7.0.0" from @vue/cli-plugin-eslint@4.5.15 npm error node_modules/@vue/cli-plugin-eslint npm error dev @vue/cli-plugin-eslint@"4.5.15" from the root project npm error npm error Conflicting peer dependency: eslint@6.8.0 npm error node_modules/eslint npm error peer eslint@">= 1.6.0 < 7.0.0" from @vue/cli-plugin-eslint@4.5.15 npm error node_modules/@vue/cli-plugin-eslint npm error dev @vue/cli-plugin-eslint@"4.5.15" from the root project npm error npm error Fix the upstream dependency conflict, or retry npm error this command with --force or --legacy-peer-deps npm error to accept an incorrect (and potentially broken) dependency resolution. npm error npm error npm error For a full report see: npm error C:\Users\www87\AppData\Local\npm-cache\_logs\2025-03-26T08_12_06_109Z-eresolve-report.txt npm error A complete log of this run can be found in: C:\Users\www87\AppData\Local\npm-cache\_logs\2025-03-26T08_12_06_109Z-debug-0.log F:\008717hz\houtai>
03-27
npm install postcss-pxtorem autoprefixer amfe-flexible -D npm error code ERESOLVE npm error ERESOLVE could not resolve npm error npm error While resolving: @vue/cli-plugin-eslint@4.5.19 npm error Found: eslint@7.32.0 npm error node_modules/eslint npm error peer eslint@">= 7.28.0" from @vue/eslint-config-prettier@7.1.0 npm error node_modules/@vue/eslint-config-prettier npm error dev @vue/eslint-config-prettier@"^7.0.0" from the root project npm error peer eslint@">= 4.12.1" from babel-eslint@10.1.0 npm error node_modules/babel-eslint npm error dev babel-eslint@"^10.1.0" from the root project npm error 6 more (eslint-config-prettier, eslint-plugin-prettier, ...) npm error npm error Could not resolve dependency: npm error peer eslint@">= 1.6.0 < 7.0.0" from @vue/cli-plugin-eslint@4.5.19 npm error node_modules/@vue/cli-plugin-eslint npm error dev @vue/cli-plugin-eslint@"^4.5.15" from the root project npm error npm error Conflicting peer dependency: eslint@6.8.0 npm error node_modules/eslint npm error peer eslint@">= 1.6.0 < 7.0.0" from @vue/cli-plugin-eslint@4.5.19 npm error node_modules/@vue/cli-plugin-eslint npm error dev @vue/cli-plugin-eslint@"^4.5.15" from the root project npm error npm error Fix the upstream dependency conflict, or retry npm error this command with --force or --legacy-peer-deps npm error to accept an incorrect (and potentially broken) dependency resolution. npm error npm error npm error For a full report see: npm error C:\Users\admin\AppData\Local\npm-cache\_logs\2025-03-05T03_23_29_961Z-eresolve-report.txt npm error A complete log of this run can be found in: C:\Users\admin\AppData\Local\npm-cache\_logs\2025-03-05T03_23_29_961Z-debug-0.log
03-08
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值