Turbopack Error: Next.js package not found #82517
Replies: 1 comment 1 reply
-
Hi @Devansh4971 You’re seeing “Next.js package not found” (with Next.js version: 0.0.0) because Turbopack can’t resolve next from your project. Here’s a fast checklist that fixes it in almost all cases. Quick fix (pick your package manager)npm rm -rf node_modules package-lock.json .next
npm install next react react-dom
npm run dev -- --turbo yarn rm -rf node_modules yarn.lock .next
yarn add next react react-dom
yarn dev --turbo pnpm rm -rf node_modules pnpm-lock.yaml .next
pnpm add next react react-dom
pnpm dev --turbo Things to double-check1. Run from the project root (the folder that has your package.json). 2. package.json must include: "dependencies": {
"next": "14.x", // or the version you use
"react": "18.x",
"react-dom": "18.x"
} (Don’t put next only in devDependencies for app runtime.) 3. Node version nvm install 20 && nvm use 20 4. Monorepo / workspaces (TurboRepo, Nx, etc.) Ensure the app package (e.g., apps/web/package.json) has next in its own dependencies or is properly hoisted. From that app’s directory, run the dev script: pnpm --filter web dev --turbo If using Yarn/PNPM workspaces, make sure nodeLinker/hoisting isn’t excluding next. 5. Lockfile mismatch 6. Corrupted install rm -rf node_modules .next
# remove the lockfile for your manager, then
corepack enable # (for yarn/pnpm if needed)
<manager> install 7. Bun npm run dev -- --turbo If it works on Node, the issue is Bun’s resolver—stick to Node for Turbopack. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Turbopack version:
91e5b6b8
Next.js version:
0.0.0
Error message:
Beta Was this translation helpful? Give feedback.
All reactions