简体   繁体   English

运行 npm 安装时 ERESOLVE 无法解决错误

[英]ERESOLVE cound not resolve error when running npm install

I'm having really difficult time resolving dependency conflicts when installing and updating npm packages.在安装和更新 npm 包时,我很难解决依赖冲突。 The console error is as below.控制台错误如下。 I tried installing legacy deps and reinstalling some modules but none seems working.我尝试安装遗留的 deps 并重新安装一些模块,但似乎没有一个工作。

Could someone help me how to resolve this conflicts?有人可以帮我解决这些冲突吗? What to delete/reinstall/update?要删除/重新安装/更新什么?

edit: using sveltekit latest version编辑:使用 sveltekit 最新版本

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @sveltejs/kit@1.0.0-next.454
npm ERR! Found: vite@2.9.15
npm ERR! node_modules/vite
npm ERR!   dev vite@"^2.9.15" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer vite@"^3.1.0-beta.1" from @sveltejs/kit@1.0.0-next.454
npm ERR! node_modules/@sveltejs/kit
npm ERR!   dev @sveltejs/kit@"next" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: vite@3.1.0-beta.1
npm ERR! node_modules/vite
npm ERR!   peer vite@"^3.1.0-beta.1" from @sveltejs/kit@1.0.0-next.454
npm ERR!   node_modules/@sveltejs/kit
npm ERR!     dev @sveltejs/kit@"next" 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 /Users/krystian/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/krystian/.npm/_logs/2022-08-30T19_09_07_228Z-debug-0.log

The error message indicates you have vite@2.9.15 installed, but @sveltejs/kit@1.0.0-next.454 expects vite@^3.1.0-beta.1 .错误消息表明您已安装vite@2.9.15 ,但@sveltejs/kit@1.0.0-next.454需要vite@^3.1.0-beta.1

A quick fix is to install that version of vite with:一个快速的解决方法是安装该版本的vite

npm i -D vite@^3.1.0-beta.1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM