Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pnpm 9.9.0 installs different Vite versions in a monorepo #8488

Closed
sheremet-va opened this issue Sep 2, 2024 · 1 comment
Closed

pnpm 9.9.0 installs different Vite versions in a monorepo #8488

sheremet-va opened this issue Sep 2, 2024 · 1 comment

Comments

@sheremet-va
Copy link

sheremet-va commented Sep 2, 2024

Last pnpm version that worked

9.7.0 (didn't check 9.8.0)

pnpm version

9.9.0

Code to reproduce the issue

renovate commit: vitest-dev/vitest@9b25553 (#6360)

  • two packages define "vite" in dependencies
  • one package (vitest) also defines "@types/node": "^20.16.3"
  • the root package overrides all "vite" with "^5.2.0"

Vite with explicit @types/node in vitest package is stored in node_modules/.pnpm/vite@5.4.2_@types+node@20.16.3_terser@5.22.0/node_modules/vite/dist/node/index

VIte in another package (vite-node) is stored in /node_modules/.pnpm/vite@5.4.2_@types+node@22.5.2_terser@5.22.0/node_modules/vite/dist/node/index

Note that vite-node's "vite" resolves to @types+node@22.5.2 which is actually not even supported by Vite's package.json:

{
  "peerDependencies": {
    "@types/node": "^18.0.0 || >=20.0.0"
  }
}

Expected behavior

Both vite packages resolve to the same path.

Actual behavior

vite packages resolve to different paths.

Additional information

No response

Node.js version

20.12.2

Operating System

macOS

@zkochan
Copy link
Member

zkochan commented Sep 3, 2024

Note that vite-node's "vite" resolves to @types+node@22.5.2 which is actually not even supported by Vite's package.json:

How so? The >=20.0.0 part covers 22.5.2 as well:

{
  "peerDependencies": {
    "@types/node": "^18.0.0 || >=20.0.0"
  }
}

I'd recommend either removing @types/node from vite or adding it to vite-node. That should solve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants