Repository navigation
Description
Describe the bug
With Node managed mode enabled, vp install can run dependency engine checks and lifecycle scripts with an older Node.js than the version selected by the project. This happens when the managed runtime's bin directory is already on PATH after another Node.js bin directory.
In the reproduction, vp env current reports Node 26.13.1 from .nvmrc and managed mode. With Node 24.22.3 ahead of that bin directory, vp install emits an Unsupported engine warning and runs postinstall under 24.22.3.
In managed mode, I expect vp install to give the selected Node.js precedence for dependency checks and lifecycle scripts. Shell CI jobs need that behavior to be consistent when they inherit a PATH with several Node installations.
Reproduction
Steps to reproduce
- On Linux with Vite+
1.7.0, enable Node managed mode withvp env on node. - Download
repro.shand runbash repro.sh. It creates a temporary project, pins Node26.13.1, and packages a local test dependency that requires Node>=26. - Compare
vp installandvp env exec --node 26.13.1 -- pnpm installin the script. Both use the same inheritedPATHand the same pnpm version. The explicit invocation uses the pinned Node forpostinstalland clears the engine warning.
System Info
Linux x86_64 (Ubuntu on WSL). Home directory abbreviated.
Node.js:
Version 26.13.1
Source .nvmrc
Bin Path $HOME/.vite-plus/js_runtime/node/26.13.1/bin/node
Installed true
Mode managed
Package Manager:
Name pnpm
Version 12.21.0
Source packageManager
Bin Paths
pnpm $HOME/.vite-plus/package_manager/pnpm/12.21.0/pnpm/bin/pnpm
pnpx $HOME/.vite-plus/package_manager/pnpm/12.21.0/pnpm/bin/pnpx
Installed true
Mode managed
vp v1.7.0
Local vite-plus:
vite-plus Not found
Tools:
vite Not found
rolldown Not found
vitest Not found
oxfmt Not found
oxlint Not found
oxlint-tsgolint Not found
tsdown Not found
Environment:
Package manager pnpm v12.21.0
Node.js v26.13.1 (.nvmrc)
Used Package Manager
pnpm 12.21.0
Logs
Reproduction with Node 24 before the pinned Node 26 on PATH
[WARN] Unsupported engine for engine-check@file:engine-check.tgz: wanted: {"node":">=26"} (current: {"node":"24.22.3"})
. postinstall$ node --version
. postinstall: v24.22.3
Control with an explicit Node version and the same PATH
. postinstall$ node --version
. postinstall: v26.13.1
The Node path setup for vp install passes PrependOptions { dedupe_anywhere: true }. A later occurrence of the selected bin directory can satisfy that check while a different node still wins the lookup. PATH setup in v1.7.0
Validations
- Read the Contributing Guidelines.
- Searched open and closed issues for the same bug.
- Isolated the discrepancy to Vite+'s handling of
PATHusing the same pnpm and Node pins. - Verified the minimal reproduction on Linux.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Effort
Target date
Start date
Activity
ywenhao commentedon Nov 19, 2026
I also reproduced this on a Linux GitLab Shell runner with Node managed and pnpm set to
system-first.1.7.0, Node26.13.1in.nvmrc, and pnpm12.21.0inpackage.json.PATHcontains only the system bin directories (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin). Both system pnpm12.21.0and system Node20.19.5are in/usr/bin.vp --versionreports Node26.13.1from.nvmrc.With a local test dependency requiring Node
>=26,vp install --frozen-lockfileproduced this output.On a fresh copy of the same fixture,
vp env exec --node 26.13.1 --package-manager pnpm@12.21.0 -- pnpm install --frozen-lockfilepassed the engine check andpostinstallprintedv26.13.1from the managed runtime.I reproduced the same behavior locally with an isolated Vite+ config and a directory containing an older Node binary alongside a system pnpm binary. Switching only pnpm to managed mode with
vp env on pnpmmadevp installuse the project Node in that setup.The package-manager dispatch prepends the selected package manager's bin directory when creating the child environment. With system pnpm this moves
/usr/binahead of the managed Node directory. This can change Node selection even when the incomingPATHcontains only system directories. Package-manager dispatch in v1.7.0voidzero-bot commentedon Nov 19, 2026