Skip to content

[v7]: Invalid @types/node peer dependency #20147

Description

@silvenon

Describe the bug

npm install vite@beta will have mismatched peer dependencies with @types/node v20 becuase it's aiming for ^20.19, which doesn't exist.

"@types/node": "^20.19.0 || >=22.12.0",

> npm info @types/node@20 version
...
@types/node@20.17.57 '20.17.57'

The expected versions are aligned with engines.node:

"node": "^20.19.0 || >=22.12.0"

but that package isn't versioned that way. I'm not sure how it's versioned, though, so I wouldn't know what to suggest off the top of my head.

Reproduction

Hopefully not needed in this case.

Steps to reproduce

npm install vite@beta @types/node@20
npm warn Conflicting peer dependency: @types/node@22.15.29
npm warn node_modules/@types/node
npm warn   peerOptional @types/node@"^20.19.0 || >=22.12.0" from vite@7.0.0-beta.0
npm warn   node_modules/vite
npm warn     dev vite@"7.0.0-beta.0" from the root project

System Info

System:
    OS: macOS 15.5
    CPU: (8) arm64 Apple M1 Pro
    Memory: 149.89 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.19.1 - ~/.n/bin/node
    npm: 10.8.2 - ~/.n/bin/npm
    pnpm: 7.0.0 - ~/.n/bin/pnpm
    bun: 1.1.29 - ~/.bun/bin/bun
  Browsers:
    Brave Browser: 133.1.75.181
    Chrome: 136.0.7103.116
    Edge: 137.0.3296.52
    Safari: 18.5
  npmPackages:
    @vitejs/plugin-react: ^4.5.0 => 4.5.0 
    vite: ^7.0.0-beta.0 => 7.0.0-beta.0

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    has workaroundp3-minor-bugAn edge case that only affects very specific usage (priority)

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions