code ERESOLVE, ERESOLVE could not resolve

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: biyedurg@0.1.0
npm ERR! Found: webpack@4.46.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.5.15
npm ERR! node_modules/@vue/cli-service
npm ERR! peer @vue/cli-service@"^3.0.0 || ^4.0.0-0" from @vue/cli-plugin-babel@4.5.15
npm ERR! node_modules/@vue/cli-plugin-babel
npm ERR! dev @vue/cli-plugin-babel@"~4.5.0" from the root project
npm ERR! 4 more (@vue/cli-plugin-eslint, @vue/cli-plugin-router, …)
npm ERR! peer webpack@"^4.0.0 || ^5.0.0" from @soda/friendly-errors-webpack-plugin@1.8.0
npm ERR! node_modules/@soda/friendly-errors-webpack-plugin
npm ERR! @soda/friendly-errors-webpack-plugin@"^1.7.1" from @vue/cli-service@4.5.15
npm ERR! node_modules/@vue/cli-service
npm ERR! peer @vue/cli-service@"^3.0.0 || ^4.0.0-0" from @vue/cli-plugin-babel@4.5.15
npm ERR! node_modules/@vue/cli-plugin-babel
npm ERR! dev @vue/cli-plugin-babel@"~4.5.0" from the root project
npm ERR! 4 more (@vue/cli-plugin-eslint, @vue/cli-plugin-router, …)
npm ERR! 18 more (@vue/cli-plugin-babel, @vue/cli-plugin-eslint, …)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev less-loader@"" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: webpack@5.68.0
npm ERR! node_modules/webpack
npm ERR! peer webpack@"^5.0.0" from less-loader@10.2.0
npm ERR! node_modules/less-loader
npm ERR! dev less-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 D:\qianduan\node\node_cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR! D:\qianduan\node\node_cache_logs\2022-02-03T23_02_43_147Z-debug-0.log

解决办法,在我们的命令后面添加

–legacy-peer-deps

应该就可以成功解决这个问题了

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
报错信息 "code ERESOLVE ERESOLVE could not resolve" 通常是由于依赖模块的版本冲突或无法解析导致的。根据引用内容,报错信息中提到了 npm 版本的问题。 根据引用,报错信息中还提到了缺少 "less" 模块。这可能是由于项目中使用了 less,但是没有将其作为依赖安装导致的。你可以尝试通过运行 "npm install less" 命令来安装 less 模块。 引用提到,报错可能是由 npm 版本的问题引起的。你可以尝试将 npm 版本降级到 6.0 来解决该问题。可以通过运行 "npm install -g npm@6.0" 命令来降级 npm 版本。 另外,引用也提到了可能是版本问题导致的。你可以尝试查看项目依赖中的版本是否有冲突,并尝试将相关模块版本进行调整。 综上所述,解决 "code ERESOLVE ERESOLVE could not resolve" 报错的方法有: 1. 确保安装了缺少的模块,比如运行 "npm install less" 安装 less 模块。 2. 将 npm 版本降级到 6.0,可以通过运行 "npm install -g npm@6.0" 命令来降级 npm 版本。 3. 检查项目依赖中的版本是否有冲突,并尝试调整相关模块版本。 希望以上方法能够帮助你解决问题。如果还有其他疑问,请随时向我提问。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! Vue开发中安装库经常报错](https://blog.csdn.net/A13526_/article/details/125842394)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* *3* [解决:code ERESOLVE:ERESOLVE could not resolve 的报错问题](https://blog.csdn.net/weixin_43405300/article/details/125752619)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值