How to Perform an Angular 16 Install Using the Angular CLI

To install Angular 16 specifically, run npm install -g @angular/cli@16 for a global installation or use npx @angular/cli@16 new my-app to scaffold a project without a permanent global installation.

Installing a specific major version of the Angular framework requires explicit version tagging when using the Angular CLI. Whether you are maintaining legacy applications or starting new projects that require the Angular 16 release line, you must target the @angular/cli package with a specific version suffix. According to the angular/angular repository source code, the CLI supports both global installations and temporary execution via npx to accommodate different development workflows.

Global vs. Temporary Angular 16 Installation

The Angular CLI is distributed as the npm package @angular/cli. To perform an angular 16 install, you have two primary approaches: a persistent global installation that registers the ng command on your system PATH, or a temporary execution using npx that avoids permanent installation.

Installing Angular 16 CLI Globally

For a permanent setup, use the global install flag with an explicit version tag. As documented in adev/src/content/tools/cli/setup-local.md (lines 38-46), the generic global install command supports version suffixes:

npm install -g @angular/cli@16

This command resolves the @16 tag to the latest patch release within the Angular 16 major line (e.g., 16.2.12) and registers the ng binary globally.

Using NPX for Temporary Angular 16 Install

When you need to scaffold a project without modifying your global environment, use npx to execute a specific CLI version. The angular/angular repository demonstrates this pattern in adev/src/app/features/update/recommendations.ts (lines 251-260) for version-specific migrations:

npx @angular/cli@16 new my-app

This approach downloads and executes Angular 16 temporarily, creating the project structure without leaving a permanent global installation on your machine.

Creating New Angular 16 Projects

Once you have the CLI installed (globally or via npx), generating a new workspace requires specifying the version if using npx, or simply invoking ng if installed globally.

Scaffold with Global CLI

If you performed the global angular 16 install, create a new project:

ng new my-angular-16-project
cd my-angular-16-project
ng serve

The ng new command uses the globally installed version 16 to generate project files compatible with that release line.

Scaffold with Specific Version via NPX

To ensure you are using Angular 16 even if you have other versions installed globally, explicitly invoke version 16:

npx @angular/cli@16 new my-angular-16-project

This guarantees the project is generated using Angular 16 schematics and dependencies, regardless of your global CLI state.

Updating Existing Projects to Angular 16

Migrating an existing Angular application to version 16 requires updating both the CLI and core framework packages. The Angular update recommendations in the source code suggest using npx to ensure the migration scripts run with the correct CLI version.

Run the update command with version pinning:

NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@16 update @angular/cli@16 @angular/core@16

Setting NG_DISABLE_VERSION_CHECK=1 prevents the CLI from warning about version mismatches during the migration process. This command updates your package.json dependencies and runs Angular 16 migration schematics to modify your source code for breaking changes.

Verifying Your Angular 16 Installation

After installation, confirm you are running the correct version:

ng version

Look for the line indicating Angular CLI version 16.x.x. If you used npx, the version output reflects the temporarily downloaded CLI.

Summary

  • Global install: Use npm install -g @angular/cli@16 to permanently add Angular 16 to your system PATH.
  • Temporary execution: Use npx @angular/cli@16 to run Angular 16 commands without global installation.
  • Project creation: Both ng new (global) and npx @angular/cli@16 new (specific) scaffold Angular 16 compatible projects.
  • Updates: Migrate existing projects using npx @angular/cli@16 update with the NG_DISABLE_VERSION_CHECK=1 flag.

Frequently Asked Questions

How do I install Angular 16 specifically without affecting other Angular versions on my system?

Use the npx command to execute Angular 16 temporarily without modifying your global installation. Run npx @angular/cli@16 new my-app to create a project, or npx @angular/cli@16 serve to run a development server. This approach keeps your global CLI at its current version while allowing you to work with Angular 16 for specific projects.

What is the difference between npm install -g @angular/cli@16 and npx @angular/cli@16?

The npm install -g command permanently installs Angular 16 on your system, registering the ng command globally and allowing you to invoke it from any directory. In contrast, npx downloads and executes the specified version temporarily without installing it globally; it is ideal for CI/CD pipelines, testing specific versions, or avoiding conflicts with other projects requiring different Angular versions.

How do I update an existing Angular project to version 16?

Navigate to your project directory and run the update command using npx to ensure the migration runs with the correct CLI version: NG_DISABLE_VERSION_CHECK=1 npx @angular/cli@16 update @angular/cli@16 @angular/core@16. This updates your package.json dependencies and automatically runs Angular 16 migration schematics to adjust your code for any breaking changes introduced in that major version.

Can I check which Angular version is currently installed globally?

Yes, run the ng version command in your terminal. The output displays the Angular CLI version, Node.js version, and operating system details. If you need to check a specific project's Angular version, run ng version from within that project directory to see the local CLI and core framework versions defined in package.json.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →