首页 > 其他分享 >解决npm ERR! code ERESOLVE -npm ERR! ERESOLVE could not resolve

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

时间:2023-08-04 13:45:19浏览次数:33  
标签:npm 4.4 vue cli ERR plugin ERESOLVE

 

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

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/webpack
npm ERR! webpack@"^4.0.0" from @vue/[email protected]
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/[email protected]
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/[email protected]
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: [email protected]
npm ERR! node_modules/webpack
npm ERR! peer webpack@"^5.0.0" from [email protected]
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. 项目使用了 [email protected]
  2. 项目需要 [email protected],在 @vue/[email protected]@vue/[email protected] 中指定了这个版本。
  3. less-loader 的依赖发生了冲突。项目需要 less-loader@"^11.1.0",但与此冲突的是 [email protected],它需要 less-loader@"^11.1.3"

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

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

标签:npm,4.4,vue,cli,ERR,plugin,ERESOLVE
From: https://www.cnblogs.com/taoshihan/p/17605670.html

相关文章

  • Uncaught SyntaxError: Identifier 'originalPrompt' has already been declared
    控制台报错:UncaughtSyntaxError:Identifier'originalPrompt'hasalreadybeendeclared网上查询相关资料,预测是GoogleChrome浏览器安装了插件跟Vue项目运行代码出现了冲突。解决方法:关闭相关插件即可,【可能导致问题产生的插件有:SeleniumIDE】。参考文档:http://www.dtm......
  • Undefined symbol HAL_SRAM_Init (referred from lcd.o) 报错无法使用HAL_SRAM_Init
    前言最近在使用HAL库配置FSMC的时候,发现在使用CubeMX生成的fsmc的配置文件,编译不会报错:UndefinedsymbolHAL_SRAM_Init(referredfromlcd.o)而自己移除CubeMX生成的配置文件,一步步自己配置,就会出现上诉报错,并且将stm32f4xx_hal_sram.h文件包括进去后,仍然报错,奇怪的是MDK编......
  • SLF4J warning or error messages and their meanings(转)
     Themethod o.a.commons.logging.impl.SLF4FLogFactory#release wasinvoked.Giventhestructureofthecommons-loggingAPI,inparticularasimplementedbySLF4J,the o.a.commons.logging.impl.SLF4FLogFactory#release()methodshouldneverbecalled.However,d......
  • 【面试精讲】Java:Exception 和 Error 有什么区别?
    前言众所周知,没有BUG的程序只会出现在程序员的梦里,异常情况如影随形地纠缠着我们,只有正确处理好意外情况,才能保证程序的可靠性。Java语言在设计之初就提供了相对完善的异常处理机制,这也是Java得以大行其道的原因之一,因为这种机制大大降低了编写和维护可靠程序的门槛。如今,异常......
  • [err] 1118 Row size too large.
      一个工单表字段多+个别字段使用较长(上千)varchar,导致err1118 解决是将这些超长varchar转换为text,注意MBG生成的mapper会有变化这种业务数据量逐年增长,表字段不断增加。可采取冷热数据分离(横向分表,业务分隔),业务字段分离(纵向分表,关联查询) https://dev.mysql.com......
  • npm - 报错:found XXX vulnerabilities (XXX low, X moderate),run `npm audit fix` to
    完整报错我正准备 npm 装包,结果失败了,并提示如下报错信息:found808vulnerabilities(804low,4moderate)run`npmauditfix`tofixthem,or`npmaudit`fordetails解决直接按照后面提示的命令执行:npmauditfix解决xxxpackagesarelookingforfundingn......
  • [async]子线程内开启协程 RuntimeError: There is no current event loop in thread '
    在子线程内直接获取事件循环会报错:RuntimeError:Thereisnocurrenteventloopinthread'Thread-2',此时的代码为:loop=asyncio.get_event_loop()loop.run_until_complete(协程函数) #执行解决方法:在子线程内创建并配置事件循环new_loop=asyncio.new_event_loop(......
  • pyppeteer异常:ValueError: signal only works in main thread
    当在子线程中调用pyppeteer工具的时候,会报错:ValueError:signalonlyworksinmainthread。解决方案:在创建浏览器对象时,加上以下三个字段: ......
  • npm更新指定的组件
    npm更新指定的组件1、例如:react-router已经更新到4.x版本,想要下载2.x版本,可以通过下面命令[email protected][email protected]、–save-dev–save:将保存配置信息到package.json。默认为dependencies节点中。–dev:将保......
  • 遇到:ValueError: not enough values to unpack (expected 2, got 1) 错误应该如何解决
    遇到"ValueError:notenoughvaluestounpack(expected2,got1)"错误时,通常是因为你在尝试解包(unpack)一个包含不足两个值的可迭代对象。要解决这个问题,你可以考虑以下几个步骤:检查可迭代对象的长度:确保你的可迭代对象包含至少两个值。如果你的可迭代对象只有一个值,那么解包......