📜  ng command new app - Shell-Bash (1)

📅  最后修改于: 2023-12-03 15:03:10.413000             🧑  作者: Mango

Creating a New App Using 'ng command new app - Shell-Bash'

The Angular CLI (Command Line Interface) provides a convenient way to create new Angular applications. One of the most common ways to create a new app is by using the ng new command. In this article, we will look at how to create a new Angular application using the ng new command in a Shell-Bash environment.

Prerequisites

Before we start creating a new Angular application, make sure you have the following software installed on your system:

  • Node.js (version 10.13 or higher)
  • npm (version 6.4.1 or higher)
  • Angular CLI (version 8.3.0 or higher)
Steps to Create a New Angular Application Using 'ng command new app'
  1. Open your preferred terminal (e.g., Command Prompt, PowerShell, Terminal, etc.) and navigate to the directory where you want to create your new Angular application.

  2. Run the following command in your terminal:

    ng new app
    

    This command creates a new Angular application with the name app. You can replace app with the name of your choice.

    $ ng new app
    
  3. When prompted, select the default options for your new Angular application such as the stylesheet format (CSS, SCSS, SASS, etc.).

  4. Wait for the CLI to create your new Angular application. This may take a few minutes depending on your internet speed and system configuration.

  5. Once the process is complete, navigate to the newly created application directory:

    cd app
    
    $ cd app
    
  6. Finally, start the Angular development server by running the following command:

    ng serve --open
    

    This command starts the development server and opens the application in your default web browser. You can now start building and testing your Angular application.

    $ ng serve --open
    

Congratulations! You have successfully created a new Angular application using the ng new command in a Shell-Bash environment. You can now start building amazing applications using Angular.