tipex icon indicating copy to clipboard operation
tipex copied to clipboard

Unable to resolve dependency tree

Open SA9102 opened this issue 8 months ago • 1 comments

I have an application that uses SvelteKit ^2.0.0 and Svelte ^4.2.7. When installing @friendofsvelte/tipex, I get an error saying that it's unable to resolve some dependencies:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/svelte
npm ERR!   dev svelte@"^4.2.7" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer svelte@"^5.0.0-next.1" from @friendofsvelte/[email protected]
npm ERR! node_modules/@friendofsvelte/tipex
npm ERR!   @friendofsvelte/tipex@"*" from the root project

Not quite able to make out exactly what the issue is, but I think it's to do with my version of Svelte. I think the package is looking for Svelte version ^5.0.0 but I'm using Svelte 4.

I'm able to get past this issue by using the --legacy-peer-deps flag, though this might not be a good solution for long term.

Alternatively, if I use Svelte 5, I don't need to use the flag and the package gets installed , but I get some peer dependency conflicts:

npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: [email protected]
npm WARN Found: [email protected]
npm WARN node_modules/svelte
npm WARN   peer svelte@"^4.0.0 || ^5.0.0-next.0" from @sveltejs/[email protected]
npm WARN   node_modules/@sveltejs/kit
npm WARN     peer @sveltejs/kit@"^2.0.0" from @sveltejs/[email protected]
npm WARN     node_modules/@sveltejs/adapter-auto
npm WARN     1 more (the root project)
npm WARN   6 more (@sveltejs/vite-plugin-svelte, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer svelte@"^3.19.0 || ^4.0.0" from [email protected]
npm WARN node_modules/@sveltejs/vite-plugin-svelte/node_modules/svelte-hmr
npm WARN   svelte-hmr@"^0.16.0" from @sveltejs/[email protected]
npm WARN   node_modules/@sveltejs/vite-plugin-svelte
npm WARN
npm WARN Conflicting peer dependency: [email protected]
npm WARN node_modules/svelte
npm WARN   peer svelte@"^3.19.0 || ^4.0.0" from [email protected]
npm WARN   node_modules/@sveltejs/vite-plugin-svelte/node_modules/svelte-hmr
npm WARN     svelte-hmr@"^0.16.0" from @sveltejs/[email protected]
npm WARN     node_modules/@sveltejs/vite-plugin-svelte

SA9102 avatar Jun 11 '24 10:06 SA9102