Performance: Installing and creating an Astro project
This affects the initial page load speed and bundle size by determining how much code and assets are included from the start.
npm create astro@latest -- --template minimal
# Keep dependencies minimal and add features only as needednpm create astro@latest -- --template minimal
# Then install many unnecessary dependencies and add large UI frameworks before first build| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Minimal Astro project template | Minimal DOM nodes | 1 reflow on initial load | Low paint cost | [OK] Good |
| Astro project with many heavy dependencies | More DOM nodes and scripts | Multiple reflows due to scripts | High paint cost | [X] Bad |
npm create astro@latest, which sets up the project files.npm install astro installs a package but doesn't create a project; npm run dev runs the project; astro init is not a valid command.npm install inside the project folder to download all needed packages.npm create astro@latest creates the project; npm run dev runs the development server; npm start is not standard for Astro.npm run dev inside your Astro project folder?npm install installs dependencies; creating a project is done by npm create astro@latest; building for production uses npm run build.npm run dev but your site does not show up in the browser. What is the most likely cause?npm install was not run, the dev server may fail or not load properly.npm run dev outside the project folder or forgetting to create the project can cause errors, but missing dependencies is the most common cause.npm create astro@latest to generate the project files.npm install to get all packages, then npm run dev to start the server.npm run dev before installing dependencies or creating the project causes errors; installing before creating is illogical.Pass the test and this pattern moves unknown