在安装和更新npm包时,我很难解决依赖关系冲突。控制台错误如下。我试着安装旧的deps并重新安装一些模块,但似乎都不起作用。
有人能帮我解决这些矛盾吗?要删除/重新安装/更新什么?
编辑:使用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
错误消息指示您安装了vite@2.9.15
,但@sveltejs/kit@1.0.0-next.454
需要vite@^3.1.0-beta.1
。
一个快速解决方案是安装带有以下的vite
版本
npm i -D vite@^3.1.0-beta.1