You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Especially when using native deps that need to be built against against the current Node version, npm rebuild is necessary. Unfortunately, vp doesn't support that yet.
Understanding the issue: The request is for a top-level vp rebuild command as a convenience shortcut for npm rebuild / pnpm rebuild, which is needed for rebuilding native Node.js addons against the current Node version.
Current state:vp pm rebuild (with alias vp pm rb) already exists and is fully implemented in crates/vite_install/src/commands/rebuild.rs. It supports npm, pnpm, and warns gracefully for yarn v1 (which doesn't support rebuild). The underlying RebuildCommandOptions and run_rebuild_command are complete.
Relevant files:
crates/vite_global_cli/src/main.rs — normalize_args() function handles vp list → vp pm list aliasing
The implementation is already done at the vp pm rebuild level. Adding vp rebuild is a matter of wiring the top-level shortcut.
Implementation plan
Option A (preferred — consistent with existing vp list pattern): Extend normalize_args() in crates/vite_global_cli/src/main.rs to map vp rebuild / vp rb → vp pm rebuild:
Option B (alternative): Add a dedicated Commands::Rebuild variant to the top-level Commands enum in cli.rs, with a handler that calls commands::pm::run(cwd, PmCommands::Rebuild { ... }) directly — more explicit but slightly more code.
Option A is simpler, consistent with how vp list is handled, and requires changes to only one function.
Potential concerns
rb is already a visible_alias on vp pm rebuild — using it as a top-level alias via normalization would shadow it cleanly, but worth verifying there's no conflict.
Yarn v1 already has a graceful warning in the existing implementation, so that edge case is handled.
Activity
claude commentedon Mar 20, 2026
Analysis
Understanding the issue: The request is for a top-level
vp rebuildcommand as a convenience shortcut fornpm rebuild/pnpm rebuild, which is needed for rebuilding native Node.js addons against the current Node version.Current state:
vp pm rebuild(with aliasvp pm rb) already exists and is fully implemented incrates/vite_install/src/commands/rebuild.rs. It supports npm, pnpm, and warns gracefully for yarn v1 (which doesn't support rebuild). The underlyingRebuildCommandOptionsandrun_rebuild_commandare complete.Relevant files:
crates/vite_global_cli/src/main.rs—normalize_args()function handlesvp list→vp pm listaliasingcrates/vite_global_cli/src/cli.rs—PmCommands::Rebuild(line 1212–1218), top-levelCommandsenumcrates/vite_install/src/commands/rebuild.rs— Core implementationcrates/vite_global_cli/src/commands/pm.rs—PmCommands::RebuildhandlerVerdict: Yes, fixable — low complexity
The implementation is already done at the
vp pm rebuildlevel. Addingvp rebuildis a matter of wiring the top-level shortcut.Implementation plan
Option A (preferred — consistent with existing
vp listpattern): Extendnormalize_args()incrates/vite_global_cli/src/main.rsto mapvp rebuild/vp rb→vp pm rebuild:Option B (alternative): Add a dedicated
Commands::Rebuildvariant to the top-levelCommandsenum incli.rs, with a handler that callscommands::pm::run(cwd, PmCommands::Rebuild { ... })directly — more explicit but slightly more code.Option A is simpler, consistent with how
vp listis handled, and requires changes to only one function.Potential concerns
rbis already avisible_aliasonvp pm rebuild— using it as a top-level alias via normalization would shadow it cleanly, but worth verifying there's no conflict.cpojer commentedon Mar 20, 2026
Yep, agreed we should have this at the top level. No need to add
rbas an alias though.feat(cli): add top-level rebuild alias (voidzero-dev#1383)