Reference

Package Manager Support

Use npm, yarn, pnpm, or bun — CEM auto-detects your package manager and adapts scaffolding, Docker, generated scripts, and CLI output.

Run without installing

bash
# npm
npx create-express-modular my-api

# yarn
yarn create express-modular my-api

# pnpm
pnpm dlx create-express-modular my-api

# bun
bunx create-express-modular my-api

Install globally

bash
npm install -g create-express-modular
yarn global add create-express-modular
pnpm add -g create-express-modular
bun add -g create-express-modular

How detection works

CEM picks your package manager from these signals (highest priority first):

  • Lock file in the project root — bun.lock / bun.lockb, pnpm-lock.yaml, yarn.lock, or package-lock.json.
  • npm_config_user_agent env var, automatically set when npm / yarn / pnpm / bun invokes a script.
  • Defaults to npm.

Dynamic PM version detection & error handling

CEM inspects your installed package manager binary dynamically at runtime (e.g. querying bun --version or pnpm --version) to ensure compatibility with modern flag syntax and feature sets.

If a dependency installation fails during scaffolding, CEM does not fail silently or mask the error — it captures and streams the complete raw stderr and stdout output directly into the terminal, allowing you to instantly diagnose network timeouts, supply-chain constraints, or registry misconfigurations.

Bun support

Bun is supported as a first-class citizen alongside npm, yarn, and pnpm:

bash
# One-shot scaffolding
bunx create-express-modular my-api

# Global CLI installation
bun add -g create-express-modular

# Running project scripts
bun run start:dev     # cem dev
bun run build         # cem build
bun run check         # cem check
bun run fix           # cem fix
bun start             # cem start

What changes per PM

  • Install commands used during scaffolding (bun install, pnpm install, etc.)
  • Generated README.md snippets
  • Dockerfile lock file + install command (corepack enabled for pnpm, bun image layers for bun)
  • Update notices and inline tips in CLI output
  • A single-pass ultra-fast installer with pre-populated version pins, so dependencies land in one shot

Generated scripts

bash
# npm
npm run start:dev      # cem dev
npm run build          # cem build
npm start              # cem start
npm run check          # cem check
npm run fix            # cem fix

# yarn / pnpm / bun
yarn start:dev   |  pnpm start:dev   |  bun start:dev
yarn build       |  pnpm build       |  bun run build
yarn start       |  pnpm start       |  bun start
yarn check       |  pnpm check       |  bun run check
yarn fix         |  pnpm fix         |  bun run fix