Quick answer: Install the CLI with npm install -g @angular/cli (or use npx), then run ng new my-app and ng serve. Angular’s project is organised around one folder, src/app, where every component, service and route lives. Learning four CLI commands — new, generate, serve and build — is enough to work productively.

Check Node first

Angular needs a current Node.js LTS. Run node -v; if it fails or reports an old version, install the LTS release from nodejs.org. Every modern Angular release requires a recent Node, and the CLI will tell you plainly when yours is too old.

Create the project with the Angular CLI

npm install -g @angular/cli
ng new my-app --defaults --routing --style=css
cd my-app
ng serve

The --defaults flag skips the interactive prompts and accepts today’s sensible choices: standalone components, strict TypeScript and Vitest for testing. --style=css keeps plain CSS unless your team uses something else. The dev server starts on http://localhost:4200 and reloads on every save. If you have never created a project before, our step-by-step Angular install guide covers the same ground with screenshots of each prompt.

The files that matter

A new project creates dozens of files, but you only touch a handful at first. Everything you write lives in src/app.

PathWhat it does
src/main.tsBootstraps the app — rarely edited
src/app/app.component.tsRoot component class
src/app/app.component.htmlRoot template — start here
src/app/app.routes.tsRoute table for the router
src/app/app.config.tsApplication-wide providers
angular.jsonBuild and serve configuration

Notice there is no app.module.ts. New projects boot through main.ts using bootstrapApplication, so a single root component replaces the old root module. If a tutorial mentions AppModule, it predates the standalone default.

The four Angular CLI commands you will use daily

ng generate component product-card
ng generate service cart
ng generate guard auth
ng build

ng generate (or its short form, ng g) scaffolds a component, service, guard, pipe or directive with the files and imports already wired. Generating rather than hand-creating files keeps naming and folder conventions consistent across the team. Then ng build produces an optimised bundle in dist/ when you are ready to deploy.

One useful habit: run ng serve in one terminal and keep it running while you work. The dev server rebuilds incrementally, so a save shows up in the browser in well under a second.

Where to go next

With a running project, the next step is understanding how it is put together — how components, services and providers relate. Continue with our guide to Angular’s architecture and standalone components.

Prefer to learn the CLI and project layout with someone guiding you through a real build? Ampersand Academy runs one-to-one Angular training from setup to deployment.

Frequently asked questions

What Node version does Angular need?

A current Node.js LTS release. Install it from nodejs.org if node -v fails or shows an old version, because every modern Angular release requires a recent Node.

Why is there no app.module.ts in my project?

New Angular projects are standalone by default. The app boots from main.ts with bootstrapApplication and a root component, so a root NgModule is no longer created.

What is the difference between ng serve and ng build?

ng serve runs a development server with live reload for daily work. ng build produces an optimised production bundle in the dist folder for deployment.

Where do I write my code in an Angular project?

Almost everything lives in src/app. Components, services, guards and routes go there, and the CLI places new files in the right folder for you.

Can I use JavaScript instead of TypeScript in Angular?

No. Angular is written in TypeScript and its decorators, templates and tooling depend on it. You can write minimal type annotations as a beginner, but the language is TypeScript.

Last updated on · Written by