Overview
create-nextjs-dapp automatically detects which package manager you’re using and adapts its commands accordingly. It supports npm, yarn, pnpm, and bun.Auto-Detection
The CLI uses thenpm_config_user_agent environment variable to detect which package manager invoked the command:
src/helpers/get-pkg-manager.ts:3-19
Supported Package Managers
npm
The default package manager. Used when no other package manager is detected.- Install:
npm install - Run dev:
npm run dev
yarn
Automatically detected when usingyarn create.
- Install:
yarn - Run dev:
yarn dev
pnpm
Automatically detected when usingpnpm create.
- Install:
pnpm install - Run dev:
pnpm dev
bun
Automatically detected when usingbunx.
- Install:
bun install - Run dev:
bun dev
Override Flags
You can override the auto-detected package manager using command-line flags:src/cli/args.ts:76-83
Installation Process
When using the--install flag, the CLI runs the appropriate install command:
src/helpers/install.ts:4-24
Examples
Interactive with Auto-Detection
Non-Interactive with Specific Manager
Complete Workflow
Next Steps Commands
The CLI generates appropriate next steps based on the package manager:src/helpers/install.ts:26-37