Skip to content

[email protected] install fails in non-SvelteKit projects due to @sveltejs/kit optional peer dependency resolution #171

@XStarlink

Description

@XStarlink

Description

Installing [email protected] in a Nuxt 4 project fails with ERESOLVE because npm tries to resolve the full dependency tree of the @sveltejs/kit optional peer dependency, which pulls in @sveltejs/[email protected], which requires vite@^8.0.0. This conflicts with projects using Vite 7.x (Nuxt 4's current Vite version).

Even though @sveltejs/kit is declared as optional in peerDependenciesMeta, npm still attempts to resolve it and its transitive peer dependencies, causing a conflict for projects that don't use SvelteKit at all.

Steps to Reproduce

  1. Have a Nuxt 4 project (or any project using Vite 7.x)
  2. Install evlog@^2.6.0
  3. Run npm install

Error Output

npm error ERESOLVE could not resolve
npm error
npm error While resolving: [email protected]
npm error Found: [email protected]
npm error node_modules/evlog
npm error   evlog@"^2.6.0" from the root project
npm error
npm error Could not resolve dependency:
npm error evlog@"^2.6.0" from the root project
npm error
npm error Conflicting peer dependency: [email protected]
npm error node_modules/vite
npm error   peer vite@"^8.0.0-beta.7 || ^8.0.0" from @sveltejs/[email protected]
npm error   node_modules/@sveltejs/vite-plugin-svelte
npm error     peer @sveltejs/vite-plugin-svelte@"^3.0.0 || ^4.0.0-next.1 || ^5.0.0 || ^6.0.0-next.0 || ^7.0.0" from @sveltejs/[email protected]
npm error     node_modules/@sveltejs/kit
npm error       peerOptional @sveltejs/kit@">=2.53.4" from [email protected]
npm error       node_modules/evlog
npm error         evlog@"^2.6.0" from the root project

Environment

  • Node.js: v22.14.0
  • npm: 10.x
  • Vite: 7.3.1 (via Nuxt 4.4.2)
  • evlog: 2.6.0 (works fine on 2.5.0)

Workaround

Staying on evlog@^2.5.0 for now.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions