当前位置: 首页 > news >正文

解决npm ERR! code ERESOLVE -npm ERR! ERESOLVE could not resolve

当使用一份vue源码开发项目时,npm install 报错了

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: vue-admin-template@4.4.0
npm ERR! Found: webpack@4.46.0
npm ERR! node_modules/webpack
npm ERR! webpack@"^4.0.0" from @vue/cli-plugin-babel@4.4.4
npm ERR! node_modules/@vue/cli-plugin-babel
npm ERR! dev @vue/cli-plugin-babel@"4.4.4" from the root project
npm ERR! webpack@"^4.0.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! peer @vue/cli-service@"^3.0.0 || ^4.0.0-0" from @vue/cli-plugin-babel@4.4.4
npm ERR! node_modules/@vue/cli-plugin-babel
npm ERR! dev @vue/cli-plugin-babel@"4.4.4" from the root project
npm ERR! 2 more (@vue/cli-plugin-eslint, @vue/cli-plugin-unit-jest)
npm ERR! 2 more (@vue/cli-plugin-eslint, html-webpack-plugin)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev less-loader@"^11.1.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: webpack@5.88.2
npm ERR! node_modules/webpack
npm ERR! peer webpack@"^5.0.0" from less-loader@11.1.3
npm ERR! node_modules/less-loader
npm ERR! dev less-loader@"^11.1.0" 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\63089\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\63089\AppData\Local\npm-cache_logs\2023-08-04T04_52_18_223Z-debug-0.log

出错的原因是

  1. 项目使用了 vue-admin-template@4.4.0
  2. 项目需要 webpack@4.46.0,在 @vue/cli-plugin-babel@4.4.4@vue/cli-service@4.4.4 中指定了这个版本。
  3. less-loader 的依赖发生了冲突。项目需要 less-loader@"^11.1.0",但与此冲突的是 webpack@5.88.2,它需要 less-loader@"^11.1.3"

降低less-loader的版本,解决了

"less-loader": "^7.x.x",

http://www.lryc.cn/news/110743.html

相关文章:

  • HttpServletRequest和HttpServletResponse的获取与使用
  • css在线代码生成器
  • 在java中如何使用openOffice进行格式转换,word,excel,ppt,pdf互相转换
  • 手机变电脑2023之虚拟电脑droidvm
  • HDFS中的sequence file
  • 【MySQL】检索数据使用数据处理函数
  • 【嵌入式学习笔记】嵌入式入门6——定时器TIMER
  • GD32F103输入捕获
  • [RT-Thread]基于ARTPI的文件系统认识与搭建
  • 动态规划+二分查找
  • 8.2小非农ADP数据来袭黄金将会如何表现?
  • linux启动oracle
  • AssetBundleBrowser导入报错解决方案
  • vue-baidu-map-3x 使用记录
  • 《GPU并行计算与CUDA编程》笔记
  • Shell编程基础(十二)函数
  • 【雕爷学编程】MicroPython动手做(33)——物联网之天气预报3
  • Screens 4 for mac VNC客户端 强大的远程控制工具
  • 搜索与图论(三)
  • 阿里云“通义千问”开源,可免费商用
  • 23.7.31 牛客暑期多校5部分题解
  • Python爬虫的学习day02 requests 模块post 函数, lmxl 模块的 etree 模块
  • 客户流失分析预测案例 -- 机器学习项目基础篇(7)
  • uniapp中我使用uni.navigateTo跳转webview页面传参,但是接收的参数只有一半。
  • 使用kaminari,在列表页实现分页功能
  • Android 性能调优之bitmap的优化
  • HOT74-数组中的第K个最大元素
  • 类与对象【中】
  • uni-app:实现列表单选功能
  • vue中axios二次封装并发起网络请求配置