Follow these steps to create an Angular JS 2 project using Angular CLI.

 

  1. Install Angular CLI on your machine 
    npm install -g angular-cli

    If that doesn't work, install

    npm install -g @angular/cli

     

  2. Create a new project using ng command:
    ng new myapp

     

  3. Browse to the project folder:
    cd myapp

     

  4. Run
    npm start
    which starts the development server after building all the modules.

  5. Point your browser to http://localhost:4200 to see a welcome message, "app works!"