-
- Notifications
You must be signed in to change notification settings - Fork 10.7k
Open
Description
Vite 7 was just released a few hours ago (https://vite.dev/blog/announcing-vite7) and it drops support on Node.js versions < 20.19.
I'm using React Router as a...
framework
Reproduction
- Fork this repo: https://github.com/alanko0511/rr7-dev-yarn-version (it's a minimal
vite@6.3.5
app) - Use Node.js version manager like
fnm
to switch the Node.js version to20.12.2
- Run
yarn install
using the classic yarn (v1.22.22
) - You should see the following error:
error vite@7.0.0: The engine "node" is incompatible with this module. Expected version "^20.19.0 || >=22.12.0". Got "20.12.2" error Found incompatible module.
System Info
$ npx envinfo --system --npmPackages '{vite,react-router,@react-router/*}' --binaries --browsers System: OS: macOS 13.0 CPU: (12) arm64 Apple M2 Pro Memory: 89.42 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 20.12.2 - ~/.local/state/fnm_multishells/54581_1750774976394/bin/node Yarn: 1.22.22 - /opt/homebrew/bin/yarn npm: 10.5.0 - ~/.local/state/fnm_multishells/54581_1750774976394/bin/npm Browsers: Chrome: 137.0.7151.120 Safari: 16.1 npmPackages: @react-router/dev: ^7.6.2 => 7.6.2 @react-router/fs-routes: ^7.6.2 => 7.6.2 @react-router/node: ^7.6.2 => 7.6.2 @react-router/serve: ^7.6.2 => 7.6.2 react-router: ^7.6.2 => 7.6.2 vite: ^6.3.5 => 6.3.5
Used Package Manager
yarn
Expected Behavior
yarn install
should be successful.
Actual Behavior
yarn install
fails with the following error:
error vite@7.0.0: The engine "node" is incompatible with this module. Expected version "^20.19.0 || >=22.12.0". Got "20.12.2" error Found incompatible module.
Since I have some environments that require the use of node@20.12.2
and yarn@1.22.22
, I can't easily upgrade these two versions. To get around this, I have to add a resolutions
to the package.json
:
"resolutions": { "vite": "^6.3.5" }
When I switch to node@20.19.3
to have a successful yarn install
, then run yarn why vite
, it seems that @react-router/dev
doesn't strictly lock the version of vite-node
, allowing it to install the latest version of vite
:
$ yarn why vite yarn why v1.22.22 [1/4] 🤔 Why do we have the module "vite"...? [2/4] 🚚 Initialising dependency graph... [3/4] 🔍 Finding dependency... [4/4] 🚡 Calculating file sizes... => Found "vite@6.3.5" info Has been hoisted to "vite" info This module exists because it's specified in "devDependencies". info Disk size without dependencies: "2.66MB" info Disk size with unique dependencies: "6.24MB" info Disk size with transitive dependencies: "6.6MB" info Number of shared dependencies: 8 => Found "vite-node#vite@7.0.0" info This module exists because "@react-router#dev#vite-node" depends on it. info Disk size without dependencies: "2.31MB" info Disk size with unique dependencies: "5.89MB" info Disk size with transitive dependencies: "6.25MB" info Number of shared dependencies: 8 ✨ Done in 0.10s.