vpr appears not to preserve the pnpm lifecycle environment, causing npm-run-all2 to fall back to npm
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 58/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- javascript, rust
Direzione di ricerca
Riproduci il comportamento con il repository vue-demo collegato confrontando pnpm run check e vpr check. Traccia il modo in cui vpr fornisce variabili del ciclo di vita del package manager come npm_execpath, quindi verifica che npm-run-all2 avvii gli script figli con pnpm e che il comando parallelo abbia successo senza EBADDEVENGINES.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
In a project configured to use pnpm, running a package script through vpr causes npm-run-all2 / run-p to invoke child scripts with npm instead of pnpm.
The same script works correctly when launched with pnpm run.
The project declares pnpm as its package manager. When run-p is launched by pnpm, it correctly uses pnpm for the child scripts. When it is launched by vpr, it falls back to npm, which then fails with EBADDEVENGINES because the project only permits pnpm.
Expected behavior:
vpr checkshould preserve enough package-manager lifecycle environment for child process runners to detect pnpm.- Child scripts should be executed using pnpm, consistently with
pnpm run check.
Actual behavior:
pnpm run checksucceeds.vpr checkcausesrun-pto invoke npm for the child scripts.- npm fails because
devEngines.packageManagerrequires pnpm.
This appears to happen because the environment provided by vpr differs from the environment provided by pnpm run, particularly package-manager lifecycle variables such as npm_execpath.
A serial workaround that explicitly invokes pnpm works, but it loses parallel execution. In my project, the parallel command takes 3.94 seconds, while the serial workaround takes 6.35 seconds.
Reproduction
https://github.com/bling-yshs/vue-demo/tree/archive/vp
Steps to reproduce
-
Clone the reproduction repository.
-
Install dependencies:
vp i -
Run the parallel script directly through pnpm:
pnpm run checkAll three child scripts complete successfully.
-
Run the same script through Vite+:
vpr check -
Observe that
npm-run-all2invokes the child scripts using npm instead of pnpm. npm then exits withEBADDEVENGINESbecause the project declares pnpm indevEngines.packageManager.
System Info
D:/code/Webstorm/vue-demo
$ vp env current
VITE+ - The Unified Toolchain for the Web
Environment:
Version 24.19.0
Source .node-version
Source Path D:\code\Webstorm\vue-demo\.node-version
Project Root D:\code\Webstorm\vue-demo
Tool Paths:
node C:\Users\yshs\.vite-plus\js_runtime\node\24.19.0\node.exe
npm C:\Users\yshs\.vite-plus\js_runtime\node\24.19.0\npm.cmd
npx C:\Users\yshs\.vite-plus\js_runtime\node\24.19.0\npx.cmd
Package Manager:
Name pnpm
Version 11.20.0
Source devEngines.packageManager
Source Path D:\code\Webstorm\vue-demo\package.json
Project Root D:\code\Webstorm\vue-demo
Bin Path C:\Users\yshs\.vite-plus\package_manager\pnpm\11.20.0\pnpm\bin\pnpm.cmd
D:/code/Webstorm/vue-demo
$ vp --version
VITE+ - The Unified Toolchain for the Web
vp v0.2.7
Local vite-plus:
vite-plus v0.2.7
Tools:
vite v8.1.5
rolldown v1.2.0
vitest v4.1.10
oxfmt v0.60.0
oxlint v1.75.0
oxlint-tsgolint v7.0.2001
tsdown v0.22.14
Environment:
Package manager pnpm v11.20.0
Node.js v24.19.0 (.node-version)
Used Package Manager
pnpm
Logs
Validations
- Read the Contributing Guidelines.
- Check that there isn't already an issue for the same bug.
- Confirm this is a Vite+ issue and not an upstream issue (Vite, Vitest, tsdown, Rolldown, or Oxc).
- The provided reproduction is a minimal reproducible example.
- Lingua principale
- Rust
- Stelle
- 5.8k
- Fork
- 263
- Merge medio
- 22h 48m
- PR unite (30g)
- 145
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di voidzero-dev/vite-plus
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
voidzero-dev/vite-plus#2804 · 1 reazione ·
-
pending triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
voidzero-dev/vite-plus#2801 · 1 reazione ·
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
voidzero-dev/vite-plus#2097 · 10 commenti · 2 reazioni ·
-
pending triage
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
voidzero-dev/vite-plus#2811 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
voidzero-dev/vite-plus#2806 · 1 commento ·
Tutte le issue di voidzero-dev/vite-plus
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
BurntSushi/jiff#653 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ZcashFoundation/zeeder#106 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
oxidize-rb/rb-sys#807 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
todo:ticket
Difficoltà 2/5 1-2 giorni Idoneità per principianti 74/100