How to Fix: create-next-app init app started with error
A freshly generated Next.js app failing on npm run dev usually points to an environment mismatch, not a broken scaffold. In this case, the most common trigger is that create-next-app generated a project using a newer Next.js and React stack than the local Node.js runtime can reliably support, which causes the dev server to crash during startup.
Understanding the Root Cause
When you run npx create-next-app@latest, the generated app uses the latest stable toolchain available at that time. That means your project may depend on a combination of Next.js, React, SWC, and modern ESM behavior that expects a supported version of Node.js.
If your machine is running an older or incompatible Node version, the app can fail immediately when starting the development server. This often appears as a startup exception, a failed dependency load, or an internal build error right after npm run dev.
Technically, this happens because:
- Next.js releases define a minimum supported Node.js version.
- The generated app may enable features that rely on newer runtime APIs.
- Native build components such as SWC can behave differently across platforms and Node versions.
- A lockfile or cached dependency tree can preserve a bad install after the first failure.
If the issue reproduces immediately in a brand-new app, the problem is usually external to your application code: runtime version, package manager state, or a corrupted install.
Step-by-Step Solution
Use the following sequence to verify the runtime, clean the install, and restart with a supported environment.
1. Check your Node.js and npm versions
node -v
npm -v
For modern Next.js releases, use a current LTS Node.js version. If you are on an older major version, upgrade first.
2. Upgrade Node.js to a supported LTS version
If you use nvm, switch to a current LTS release:
nvm install --lts
nvm use --lts
node -v
If you do not use nvm, install the latest LTS from the official Node.js website.
3. Remove cached dependencies and reinstall
Inside the generated project directory, delete the install artifacts and reinstall everything cleanly:
rm -rf node_modules package-lock.json .next
npm install
On Windows PowerShell:
Remove-Item -Recurse -Force node_modules, .next
Remove-Item -Force package-lock.json
npm install
4. Start the dev server again
npm run dev
If the project starts correctly, the issue was caused by an incompatible or stale local setup.
5. If it still fails, pin a stable toolchain
Sometimes the latest scaffold pulls in versions that are valid but problematic in a specific environment. In that case, recreate the app with a known stable setup:
npx create-next-app@latest my-app
cd my-app
npm install
npm run dev
If needed, explicitly inspect installed versions:
npm list next react react-dom
You can also test after upgrading only the runtime first, which is usually enough.
6. Verify the error is not caused by local system conflicts
Make sure no custom shell configuration, proxy, antivirus, or corporate registry override is interfering with package installation. A broken dependency download can look like an application startup failure even though the root problem happened during install.
Common Edge Cases
- Using an unsupported Node.js version: This is the most common reason a new app fails instantly.
- Corrupted npm cache: If reinstalling does not help, clean the cache and try again.
npm cache clean --force
npm install
- Lockfile mismatch: Switching between npm, pnpm, and yarn can leave an inconsistent dependency tree.
- Platform-specific native dependency issues: Some environments have trouble downloading or loading the correct SWC binary.
- Corporate proxy or private registry problems: The install may complete with partially resolved packages.
- Old global tooling assumptions: Even though
npxfetches the latest app generator, your local runtime still controls execution.
If you are troubleshooting a reproducible repository, compare the local environment against a clean machine or container. That quickly confirms whether the bug is in the codebase or in the system runtime.
FAQ
Why does a brand-new create-next-app project fail without any code changes?
Because the generated code is usually fine. The failure is typically caused by an incompatible Node.js version, a corrupted dependency install, or a local environment issue rather than the starter template itself.
Do I need to downgrade Next.js to fix this?
Usually no. First upgrade to a supported Node.js LTS version and reinstall dependencies. Downgrading should only be a fallback if a specific release regression is confirmed.
How can I confirm the root cause quickly?
Run node -v, remove node_modules and the lockfile, reinstall, and retry. If the app works after a Node upgrade and clean install, the issue was environmental rather than application-level.
The most reliable fix for this issue is simple: align your Node.js version with the generated Next.js app, clear the dependency state, and reinstall cleanly. For a newly scaffolded project, that resolves the majority of startup failures.