
- Angular CLI Tutorial
- Angular CLI - Home
- Angular CLI - Overview
- Angular CLI - Environment Setup
- Angular CLI Commands
- Angular CLI - ng version
- Angular CLI - ng new
- Angular CLI - ng help
- Angular CLI - ng generate
- Angular CLI - ng build
- Angular CLI - ng run
- Angular CLI - ng serve
- Angular CLI - ng lint
- Angular CLI - ng test
- Angular CLI - ng e2e
- Angular CLI - ng add
- Angular CLI - ng analytics
- Angular CLI - ng config
- Angular CLI - ng doc
- Angular CLI - ng update
- Angular CLI - ng xi18n
- Angular CLI - Code Coverage
- Angular CLI - ng cache Command
- Angular CLI - ng completion Command
- Angular CLI - ng deploy Command
- Angular CLI - ng extracti18n Command
- Angular CLI Useful Resources
- Angular CLI - Quick Guide
- Angular CLI - Useful Resources
- Angular CLI - Discussion
Angular CLI - ng deploy Command
The ng deploy command deploys an Angular project. Specifying the project name is totally optional. If you want, specify it from the projects section in the angular.json file. Before using this command, you have to add a deployment package using ng add, which sets up deployment capabilities for your chosen platform and updates the configuration file with a deployment builder.
Syntax
The syntax of ng deploy command is as follows −
ng deploy ng [project][options]
Arguments
The ng deploy command accepts a single argument:
Sr.No. | Argument & Syntax | Description |
---|---|---|
1 | The name of the application to be deployed. |
Options
Following are the optional parameters of ng deploy command −
Sr.No. | Option & Syntax | Description |
---|---|---|
1 | --configuration Alias c | A comma-separated list of one or more named builder configurations. |
2 | --help | When used, it shows a short description of this command in the console. |
Example
To deploy an angular application, the target package should be added beforehand using ng add command. If the target is not specified for the project, the ng deploy command will return the following result in the console −
> ng deploy Cannot find "deploy" target for the specified project. You can add a package that implements these capabilities. For example: Amazon S3: ng add @jefiozie/ngx-aws-deploy Firebase: ng add @angular/fire Netlify: ng add @netlify-builder/deploy GitHub Pages: ng add angular-cli-ghpages Would you like to add a package with "deploy" capabilities now? (Use arrow keys) No Amazon S3 Firebase Netlify GitHub Pages
We chose GitHub Pages:
Would you like to add a package with "deploy" capabilities now? GitHub Pages â Determining Package Manager ⺠Using package manager: npm â Searching for compatible package version ⺠Found compatible package version: [email protected]. â Loading package information from registry â Confirming installation â Installing package UPDATE angular.json (2820 bytes)