The shadcn/ui docs make this look easy. It's fucking not. Here's what will go wrong and how to fix it without losing your mind.
What You Actually Need
The CLI randomly shits the bed, so you need backups:
- Node 18 or newer (18.17+ specifically - 18.16 breaks on Windows)
- pnpm (npm gives you dependency hell, trust me on this)
- VS Code with TypeScript extension (you'll restart it every 10 minutes)
- Coffee or whiskey (this will take 3 hours, not 30 minutes like the docs claim)
Check your setup:
node --version # Needs to be 18.17+ - 18.16 throws EACCES errors
pnpm --version # Get this or suffer through npm's broken peer deps
Make sure you have Node.js 18.17+. Yeah, the shadcn docs say 16 works, but I've debugged too many "Cannot resolve module" errors caused by Node 16's busted ESM handling. Get pnpm because npm's dependency resolution completely breaks with React 19 - you'll get peer dependency warnings that make no sense.
Creating the Next.js Project
create-next-app fails randomly. Network timeouts, registry errors, some bullshit about "permission denied" even when you're running as admin. No idea why. It just does.
Try this first:
npx create-next-app@latest my-app --typescript --tailwind --app
When that inevitably fails with ENOTFOUND or EPERM:
## Clear npm cache first - fixes 60% of weird failures
npm cache clean --force
pnpm create next-app my-app --typescript --tailwind --app
The CLI asks questions. Say yes to Turbopack (it's faster than Webpack). Say no to customizing imports (you'll break TypeScript path mapping). Say yes to ESLint unless you enjoy debugging runtime errors that a linter would catch.
If you get errors, nuke everything and start over. I've wasted entire afternoons trying to debug why create-next-app choked on a perfectly valid project name. rm -rf
and starting over saves more time than reading Next.js issue threads where half the solutions don't work.
When Your Dev Server Won't Start
Your first npm run dev
will probably shit itself with "Module not found" or "Unable to resolve dependency tree" errors.
Nuclear option that actually works:
cd my-app
rm -rf .next node_modules package-lock.json yarn.lock pnpm-lock.yaml
pnpm install
pnpm run dev
Go to http://localhost:3000
. If you see the Next.js welcome page, you win. If you get a blank white screen or "This page could not be found", check the terminal - probably some TypeScript error about missing types.
Common failures I've seen:
- "Error: listen EADDRINUSE :::3000" - something's already running on port 3000, kill it with
lsof -ti:3000 | xargs kill
- "Cannot find module 'next/font'" - you're using an old Next.js version, upgrade to 13.2+
- "Module parse failed" - usually Windows path separator bullshit, try WSL
Next step: Install shadcn/ui and watch it break in exciting new ways.