Performance: Create Next App setup
This affects the initial page load speed and bundle size by determining how the app is scaffolded and dependencies are included.
npx create-next-app@latest my-app --use-npm # Creates a minimal starter with only essential dependencies
npx create-next-app@latest my-app --use-npm --example with-redux-toolkit # This installs a large example with many dependencies not needed initially
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Minimal Create Next App setup | Minimal DOM nodes | 1 reflow on initial load | Low paint cost | [OK] Good |
| Create Next App with large example template | More DOM nodes from example | Multiple reflows due to heavy scripts | Higher paint cost | [X] Bad |
npx create-next-app@latest do when setting up a Next.js project?npx create-next-app@latestnpm run dev starts the development server with hot reload.npm start is usually for production, next dev is a lower-level command but not standard npm script, and node server.js is unrelated here.npx create-next-app@latest my-app and then cd my-app followed by npm run dev, what will you see when you open http://localhost:3000 in your browser?npx create-next-app@latest but when you try npm run dev, you get an error: command not found: next. What is the likely cause?command not found: next usually means the Next.js binary is not found in current folder's node_modules.npm run dev outside the project directory where dependencies are installed.npm run dev outside the project folder. -> Option Ablog but also want to use TypeScript from the start. Which command should you run?--typescript.-ts or --ts are not recognized, and --use-typescript is invalid.Pass the test and this pattern moves unknown