Package Manager

A package manager is a tool that automates installing, updating, and managing third-party code libraries (packages) your project depends on. For vibe coders, package managers like npm, bun, and pnpm are how you add functionality — when AI says 'install stripe', the package manager handles it.

Example

AI generates code that uses the Stripe library. You run 'npm install stripe' and the package manager downloads Stripe's code, adds it to your project, and records it in package.json so anyone else can install the same dependencies.

Package managers are the unsung heroes of modern development. They let you stand on the shoulders of thousands of open-source contributors.

ManagerCommandSpeedNotes
npmnpm installStandardComes with Node.js
bunbun installFastestModern, all-in-one toolkit
pnpmpnpm installFastEfficient disk usage
yarnyarn addFastFacebook-created alternative

What Package Managers Do

  1. Install packages — Download code libraries you need
  2. Track dependencies — Record what your project uses in package.json
  3. Lock versions — Ensure everyone uses the same package versions
  4. Run scripts — Execute commands like npm run dev or npm run build
  5. Update packages — Keep libraries current with security patches

Key Files

  • package.json — Lists your project's dependencies and scripts
  • Lock file — Records exact versions of every installed package
  • node_modules/ — Folder where downloaded packages live (never commit this)

Common Commands

npm install              # Install all dependencies
npm install stripe       # Add a new package
npm run dev              # Start development server
npm run build            # Build for production
npm update               # Update packages

The AI Connection

When AI generates code that imports a library you don't have, you'll need to install it. AI usually tells you which packages to install — just run the command in your terminal.

Ad
Favicon