kit
kit copied to clipboard
Error resolving [email protected] while using svelte5-alpha via the create CLI
Describe the bug
I went through the sveltekit create command, npm create svelte@latest
, using the sveltekit default app and installing all optional dependencies via CLI - prettier, eslint, svelte-5, etc. After cd
ing into the directory and running npm i
, an overriding peer dependency
error pops up.
Reproduction
Root app - https://github.com/akash-joshi/art/tree/173f23f3cfe208c893e2e242d9fe5aff48f3fc32
Reproduction steps:
# install all optional dependencies
npm create svelte@latest my-app
cd my-app
npm install
Logs
npm i
npm WARN ERESOLVE overriding peer dependency
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/svelte
npm ERR! peer svelte@"^3.19.0 || ^4.0.0" from [email protected]
npm ERR! node_modules/@sveltejs/vite-plugin-svelte/node_modules/svelte-hmr
npm ERR! svelte-hmr@"^0.15.3" from @sveltejs/[email protected]
npm ERR! node_modules/@sveltejs/vite-plugin-svelte
npm ERR! dev @sveltejs/vite-plugin-svelte@"^3.0.0" from the root project
npm ERR! 2 more (@sveltejs/kit, @sveltejs/vite-plugin-svelte-inspector)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional svelte@"^3.37.0 || ^4.0.0" from [email protected]
npm ERR! node_modules/eslint-plugin-svelte
npm ERR! dev eslint-plugin-svelte@"^2.35.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/svelte
npm ERR! peerOptional svelte@"^3.37.0 || ^4.0.0" from [email protected]
npm ERR! node_modules/eslint-plugin-svelte
npm ERR! dev eslint-plugin-svelte@"^2.35.1" 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!
npm ERR! For a full report see:
npm ERR! /Users/akashjoshi/.npm/_logs/2024-01-06T13_05_51_731Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in: /Users/akashjoshi/.npm/_logs/2024-01-06T13_05_51_731Z-debug-0.log
System Info
System:
OS: macOS 13.4.1
CPU: (8) arm64 Apple M1
Memory: 92.38 MB / 8.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.17.0 - /usr/local/bin/node
npm: 9.6.7 - /usr/local/bin/npm
Browsers:
Brave Browser: 115.1.56.14
Safari: 16.5.2
### Severity
annoyance
### Additional Information
_No response_
If you bump to [email protected]
it will fix that warning as it has experimental svelte 5 support.
Not sure if we wanna set that as the default in the create-svelte template or not
We can use the -next
version for users who select Svelte 5 and keep the stable version for users on Svelte 4
Doing this is still showing the vite unmet peer warning:
└─┬ @sveltejs/vite-plugin-svelte 3.0.1 └─┬ svelte-hmr 0.15.3 └── ✕ unmet peer svelte@"^3.19.0 || ^4.0.0": found 5.0.0-next.38
Can that be safely ignored?