create-next-app keeps creating a TypeScript project
Would you like to use the recommended Next.js defaults?Short answer
create-next-app now makes a TypeScript project by default. Answering Yes to the recommended defaults picks TypeScript, and --yes reuses your stored preferences. Pass --js on the command line, choose customize settings and answer No to TypeScript, or reset the saved preferences with --reset-preferences.
Fix it fast
1Find out which cause you have
Run the command with --help to see which flags your installed version knows, then create the project with the JavaScript flag.
npx create-next-app@latest --help npx create-next-app@latest my-app --js2Match what you see, then jump to its fix
What does the error look like?
Would you like to use the recommended Next.js defaults?Would you like to use TypeScript? No / Yes
Cause 1 of 2
The recommended defaults include TypeScript
1Check
The first prompt offers recommended defaults that start with TypeScript. The customize path asks the TypeScript question on its own.
ls my-app/app2Fix
Create the project again and choose the customize option, then answer No to TypeScript. Or pass the flag so no question is asked.
npx create-next-app@latest my-app --js3Verify
The new project has JavaScript files in app, such as layout.js and page.js, not .tsx files.
ls my-app/appConfirmed by nextjs.org
Cause 2 of 2
Stored preferences or --yes answer for you
1Check
The docs say --yes skips the prompts and uses saved preferences or defaults, and the default setup enables TypeScript. There is also a flag to reset stored preferences.
npx create-next-app@latest --help2Fix
Reset the stored preferences, then ask for JavaScript explicitly.
npx create-next-app@latest my-app --reset-preferences --js3Verify
The prompts appear again, or the project is created with JavaScript files.
ls my-app/appConfirmed by nextjs.org
How do I stop it coming back?
- Write the project command in your notes with --js spelled out.
- Run --help after a major Next.js update; defaults change between versions.
- Skip --yes on a shared machine, since it reuses whatever was saved before.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- WorkforceA field app, an admin console and a self-hosted Node.js server for push and reconciliation.
Related fixes
Web apps
The shell cannot find create-next-app
command not found: create-next-app
create-next-app is not meant to be installed as a shell command.
2 causes, each with a fixBack end
TypeScript cannot find '@angular/platform-browser' in an Angular project
Cannot find module '@angular/platform-browser' or its corresponding type declarations.
TS2307 means TypeScript could not turn the import into a file.
3 causes, each with a fixBack end
Angular build fails with TS2707 or "has no exported member" after installing a library
Module '"@angular/core"' has no exported member
These errors mean a library was compiled by a newer Angular than your app uses.
3 causes, each with a fixBack end
cdk synth says --app is required
--app is required either in command-line, in cdk.json or in ~/.cdk.json
The CDK CLI needs a command that runs your app and finds it in three places: the --app option, cdk.json in the project folder, or cdk.json in your home folder.
3 causes, each with a fixBack end
TypeScript cannot find module '@nestjs/core' or its type declarations
error TS2307: Cannot find module '@nestjs/common' or its corresponding type declarations.
TS2307 means TypeScript searched node_modules and found neither the package nor its types.
3 causes, each with a fixBack end
Mocha or Node cannot find ts-node/register
Error: Cannot find module 'ts-node/register'
Node resolves ts-node/register from your project's node_modules, so the package must be installed there, next to typescript.
2 causes, each with a fix