Join the AI Workshop to learn more about AI and how it can be applied to web development. Next cohort February 1st, 2026
The AI-first Web Development BOOTCAMP cohort starts February 24th, 2026. 10 weeks of intensive training and hands-on projects.
Traditional package managers like npm have limitations that can lead to inefficient storage and slow installations. Modern alternatives like pnpm and Bun solve these problems through global stores and symlinks.
The problem with npm
When you run npm install, it:
- Downloads packages to your project’s
node_modulesfolder - Duplicates packages across different projects
- Can have multiple versions of the same package
This leads to wasted disk space (the same package stored multiple times) and slow installations.
How pnpm solves this
pnpm stores all packages in a single global location (~/.pnpm-store). Each package version is stored only once, regardless of how many projects use it.
Instead of copying packages, pnpm creates:
- Hard links from the global store to a project-specific store
- Symlinks from
node_modulesto the project-specific store
# Install pnpm
npm install -g pnpm
# Use it like npm
pnpm install
pnpm add hono
pnpm benefits
- Each package version stored only once globally
- Faster installations (no re-downloading)
- Strict dependency resolution prevents phantom dependencies
- Great for monorepos
How Bun solves this
Bun takes a similar approach with a global cache at ~/.bun/install/cache, plus additional optimizations:
# Install Bun
curl -fsSL https://bun.sh/install | bash
# Use it
bun install
bun add hono
Bun is written in Zig and is significantly faster than JavaScript-based package managers.
Practical comparison
Testing with the same dependencies:
| Manager | Install Time | node_modules Size |
|---|---|---|
| npm | 18 seconds | 180MB |
| pnpm | 6 seconds | 2MB (symlinks) |
| Bun | 3 seconds | 2MB (symlinks) |
Migration
From npm to pnpm
npm install -g pnpm
rm -rf node_modules package-lock.json
pnpm install
From npm to Bun
curl -fsSL https://bun.sh/install | bash
rm -rf node_modules package-lock.json
bun install
When to use each
- npm: Legacy projects, maximum compatibility
- pnpm: Want disk savings and faster installs with Node.js compatibility
- Bun: New projects, want maximum performance, comfortable with Bun’s runtime