Skip to content

Package Management

All package operations run through PNPM inside DDEV. This ensures every developer uses identical Node and PNPM versions regardless of what is installed locally.

Terminal window
ddev pnpm <command>
Terminal window
ddev pnpm add package-name # Latest stable
ddev pnpm add package-name@1.2.3 # Specific version

Always pin versions. Unpinned versions cause unpredictable builds.

Terminal window
ddev pnpm add package-name@2.0.0 # Update to new version
ddev pnpm update # Update all packages

or

Terminal window
ddev update-packages

For a automagic experience.

Before running pnpm update:

  • Review the diff
  • Check changelogs
  • Test the application
Terminal window
ddev pnpm remove package-name

This updates both package.json and pnpm-lock.yaml.

After pulling new code:

Terminal window
ddev pnpm install

This ensures node_modules matches the lockfile.

Good reasons:

  • Solving a real problem (not “it’s nice”)
  • Actively maintained (check commits, issues, downloads)
  • No built-in alternative exists

Avoid:

  • latest, alpha, beta versions
  • Random packages from blog posts
  • Dependencies you don’t understand
TaskCommand
Installddev pnpm add pkg@version
Updateddev pnpm add pkg@new-version
Update allddev pnpm update
Removeddev pnpm remove pkg
Syncddev pnpm install