Skip to content

Package Management

This project uses PNPM inside DDEV to ensure consistent, reproducible dependency management across all environments. All package operations must be executed through:

Terminal window
ddev pnpm <command>

Running commands through DDEV ensures:

  • consistent Node & PNPM versions
  • deterministic installs
  • a stable lockfile
  • reproducible builds for all contributors

To add a new dependency:

Terminal window
ddev pnpm add <package>

This will install the package and pin the version.

Avoid installing packages without specifying a version:

Terminal window
# Avoid
ddev pnpm add some-package@latest

This will install floating versions, which makes builds unpredictable.

Always install explicit stable versions:

Terminal window
# Recommended
ddev pnpm add some-package
ddev pnpm add some-package@1.4.2
  • Only install actively maintained packages.
  • Check if a package is healthy: commits, issues, downloads, security warnings.
  • Prefer built-in Next.js/React/TypeScript features where possible.
  • Avoid “just because it’s nice” dependencies — each dependency has long-term cost.

Terminal window
ddev pnpm add <package>@<new-version>

Example:

Terminal window
ddev pnpm add zod@3.23.8
Terminal window
ddev pnpm update

Before merging such updates, always:

  • review the diff
  • check changelogs
  • validate major version bumps
  • run the project + tests

Remove a dependency cleanly:

Terminal window
ddev pnpm remove <package-name>

PNPM will automatically update both package.json and pnpm-lock.yaml.


  • Commit pnpm-lock.yaml at all times.
  • Do not edit the lockfile manually.
  • Always run package commands using ddev pnpm to avoid environment drift.
  • After pulling new changes or switching branches, run:
Terminal window
ddev pnpm install

This ensures node_modules matches the lockfile exactly.


  • Installing latest, alpha, beta, or rc versions unless explicitly required
  • Adding random packages from blog posts or Stack Overflow
  • Installing packages you don’t fully understand
  • Adding dependencies just for convenience

Every dependency impacts:

  • build size
  • attack surface
  • maintainability
  • future upgrade cost

TaskCommandNotes
Install a packageddev pnpm add pkg@x.y.zAlways pin versions
Update a packageddev pnpm add pkg@new-versionReview changelogs
Update all packagesddev pnpm updateUse sparingly
Remove a packageddev pnpm remove pkgSafe cleanup
Sync dependenciesddev pnpm installAfter lockfile changes