intermediate

Package managers

Install, resolve, lock, and run dependencies with npm, pnpm, Yarn, lockfiles, scripts, and workspaces.

Package manager interviews judge install reproducibility, dependency graph discipline, and CI behavior—not logo preference. Topics: npm, pnpm, Yarn generations, lockfiles, and workspaces.

On interviews: compare `npm install` versus `npm ci`, how lockfiles capture transitive resolution, and when strict `node_modules` layouts catch undeclared dependencies.

Common pitfalls: mutating lockfiles in CI; ignoring postinstall scripts; mixing package managers across machines; treating lockfile review as optional.

The trade-off is install speed and disk usage versus strictness and ecosystem compatibility.

Checklist:

  • Commit application lockfiles.
  • Use frozen install modes in CI.
  • Pin package manager versions.
  • Review transitive dependency diffs.