Vue安装 后 npm install webpack -g 失败原因!!!

本文介绍如何使用 Vue CLI 5.0 版本来快速创建 Vue.js 项目。针对版本更新导致的命令变化,指导读者正确使用 vue create 命令进行项目初始化。
npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: html-webpack-plugin@5.6.4 npm ERR! Found: webpack@4.47.0 npm ERR! node_modules/webpack npm ERR! peer webpack@"^4.0.0" from @intervolga/optimize-cssnano-plugin@1.0.6 npm ERR! node_modules/@intervolga/optimize-cssnano-plugin npm ERR! @intervolga/optimize-cssnano-plugin@"^1.0.5" from @vue/cli-service@4.4.4 npm ERR! node_modules/@vue/cli-service npm ERR! dev @vue/cli-service@"4.4.4" from the root project npm ERR! 5 more (@vue/cli-plugin-babel, @vue/cli-plugin-eslint, ...) npm ERR! peer webpack@"^4.0.0 || ^5.0.0" from @soda/friendly-errors-webpack-plugin@1.8.1 npm ERR! node_modules/@soda/friendly-errors-webpack-plugin npm ERR! @soda/friendly-errors-webpack-plugin@"^1.7.1" from @vue/cli-service@4.4.4 npm ERR! node_modules/@vue/cli-service npm ERR! dev @vue/cli-service@"4.4.4" from the root project npm ERR! 5 more (@vue/cli-plugin-babel, @vue/cli-plugin-eslint, ...) npm ERR! 19 more (@vue/cli-service, html-webpack-plugin, ...) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peerOptional webpack@"^5.20.0" from html-webpack-plugin@5.6.4 npm ERR! node_modules/html-webpack-plugin npm ERR! dev html-webpack-plugin@"^5.6.4" from the root project npm ERR! peer html-webpack-plugin@">=2.26.0" from @vue/preload-webpack-plugin@1.1.2 npm ERR! node_modules/@vue/preload-webpack-plugin npm ERR! @vue/preload-webpack-plugin@"^1.1.0" from @vue/cli-service@4.4.4 npm ERR! node_modules/@vue/cli-service npm ERR! dev @vue/cli-service@"4.4.4" from the root project npm ERR! 5 more (@vue/cli-plugin-babel, @vue/cli-plugin-eslint, ...) npm ERR! npm ERR! Conflicting peer dependency: webpack@5.102.1 npm ERR! node_modules/webpack npm ERR! peerOptional webpack@"^5.20.0" from html-webpack-plugin@5.6.4 npm ERR! node_modules/html-webpack-plugin npm ERR! dev html-webpack-plugin@"^5.6.4" from the root project npm ERR! peer html-webpack-plugin@">=2.26.0" from @vue/preload-webpack-plugin@1.1.2 npm ERR! node_modules/@vue/preload-webpack-plugin npm ERR! @vue/preload-webpack-plugin@"^1.1.0" from @vue/cli-service@4.4.4 npm ERR! node_modules/@vue/cli-service npm ERR! dev @vue/cli-service@"4.4.4" from the root project npm ERR! 5 more (@vue/cli-plugin-babel, @vue/cli-plugin-eslint, ...) 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! npm ERR! For a full report see: npm ERR! E:\nodejs\node_cache\_logs\2025-11-05T03_54_42_182Z-eresolve-report.txt npm ERR! A complete log of this run can be found in: E:\nodejs\node_cache\_logs\2025-11-05T03_54_42_182Z-debug-0.log
最新发布
11-06
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值