Managing Dependencies
Add, remove, and update packages through vp — which detects and wraps your project's package manager (pnpm, npm, yarn, or bun) so you use one command set regardless of which one the repo uses.
What it is#
Vite+ wraps dependency management too. vp add, vp remove, vp update, and friends run through whichever package manager the project uses — Vite+ detects it from the packageManager field or the lockfile. You type the same commands whether the repo is on pnpm, npm, yarn, or bun.
Why you'd care#
You stop context-switching between pnpm add, npm install --save, and yarn add. One muscle memory works across every project, and Vite+ makes sure the right package manager (and Node version) is used each time.
Before#
# depends on the repo…
pnpm add lodash
npm install lodash
yarn add lodash
After#
vp add lodash # works the same everywhere
Do it yourself#
In your project:
1. Add packages#
vp add zod # runtime dependency
vp add -D vitest-fetch-mock # dev dependency
2. Remove a package#
vp remove zod
(vp rm, vp un, and vp uninstall are aliases.)
3. Keep things fresh#
vp outdated # what's behind
vp update # bump to latest allowed by your ranges
vp dedupe # flatten duplicate versions
4. Understand your tree#
vp list # installed packages
vp why zod # why is this package here?
vp info zod # registry metadata for a package
5. Escape hatch#
Anything Vite+ doesn't wrap directly, forward straight to the package manager:
vp pm <command>
Gotchas#
- Don't mix tools. Running
npm installin a pnpm project can corrupt the lockfile. Letvppick the package manager so you never guess. vp addrespects the project's declaredpackageManager. If a repo pinspnpm@10,vp adduses exactly that.- The full alias set:
vp remove=rm/un/uninstall;vp update=up;vp list=ls;vp why=explain;vp info=view/show. Use whichever sticks.
Recap#
vp add / remove / update (plus outdated, dedupe, list, why, info) give you one dependency workflow over any package manager, with vp pm as the escape hatch. That wraps the Beginner series — you can now install Vite+, scaffold a project, run the daily loop, and manage packages. The Intermediate series goes under the hood of vp check and vp test, and shows how to bring an existing project onto Vite+.