Open-Source Wikis

/

Angular

/

Angular

/

Getting started

angular/angular

Getting started

This is the framework repository, not an application repository. Setup gets you a working Bazel + pnpm environment so you can build the npm packages, run unit tests, and serve the documentation site or DevTools extension. For applications using Angular, see angular.dev.

Prerequisites

Tool Required version How to install
Node.js The version pinned in .nvmrc nvm install (with nvm)
pnpm Pinned in engines.pnpm of package.json (currently 10.33.2) npm install -g pnpm
Bazel Wrapped via bazelisk (auto-fetches the version in .bazelversion) npm install -g @bazel/bazelisk
Git Any recent version OS package manager

Windows is supported through WSL2 only; native PowerShell/cmd is unsupported (see #46780). A VS Code Dev Container is provided for a turn-key Linux environment.

Clone and install

git clone git@github.com:angular/angular.git
cd angular
pnpm install

pnpm install populates node_modules from the pnpm content-addressable store and reads the workspace from pnpm-workspace.yaml. Workspace @angular/* packages resolve to source so most local edits become visible without rebuilding.

Build the packages

pnpm build

This invokes node scripts/build/build-packages-dist.mts, which delegates to Bazel to build every public npm package and writes them under dist/packages-dist/. Use pnpm diff-release-package to compare a built package against the most recent npm publish.

Run tests

Bazel is the test runner:

# Run a single target
pnpm bazel test //packages/core/test:test

# Run everything except long-running suites
pnpm test:ci

pnpm test:ci excludes the integration/, adev/, vscode-ng-language-service/, devtools/, and modules/ssr-benchmarks/ trees. Integration tests run separately via pnpm integration-tests:ci.

For day-to-day work, target a specific package:

pnpm bazel test //packages/core/test/...
pnpm bazel test //packages/router/test:test

The Bazel cache is shared across runs; remote caching is available via --config=remote for Googlers (see contributing-docs/building-and-testing-angular.md).

Serve the docs site

pnpm adev

This runs ibazel run //adev:build.serve against adev/. The site builds on first invocation (slow) and watches for changes. The same build is what ships to angular.dev.

Serve the DevTools extension

pnpm devtools:devserver

Starts the DevTools UI on http://localhost:4200, embedded in a "development shell" that loads the inspected app in an iframe. To install as a real browser extension:

pnpm devtools:build:chrome:debug
# Then load dist/bin/devtools/projects/shell-browser/src/prodapp via chrome://extensions

See apps/devtools for full extension setup.

Serve the dev-app

pnpm dev

The dev-app/ project is a scratch Angular app for trying out framework changes against ordinary application code. Use it when you need to manually validate a change in a real browser.

Common scripts

Script What it does
pnpm lint Runs tslint and ng-dev format changed --check
pnpm public-api:check / :update Verifies / refreshes goldens/public-api/*.d.ts
pnpm symbol-extractor:check / :update Verifies / refreshes bundle-size symbol snapshots
pnpm ts-circular-deps:check Detects newly introduced circular imports
pnpm benchmarks Runs the local benchmark harness
pnpm zonejs:release Builds zone.js for release

Troubleshooting

  • bazel:bazel failed: missing input file — usually a stale Bazel cache. Run pnpm bazel clean (or pnpm bazel clean --expunge for a hard reset). Documented in adev/README.md.
  • Slow first build — the first pnpm adev/pnpm dev invocation builds the entire framework. Subsequent runs use the Bazel cache.
  • TypeScript version mismatch — the repo pins TypeScript via resolutions in package.json. Use the workspace TypeScript via your editor's "Use Workspace Version" setting, not the global install.
  • Symlink resolution errors with the CLI — when running the Angular CLI against a locally built copy, pass --preserve-symlinks --preserve-symlinks-main to Node.

Next steps

Once your environment builds, read how-to-contribute/index for the PR process and how-to-contribute/development-workflow for branch and commit conventions.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Getting started – Angular wiki | Factory