Monday, October 1, 2018

JavaScript - Angular - Install Angular CLI

To create an angular project, we need to first setup our development environment. First let us install the latest version of NodeJS. Visit the nodejs website and download the LTS version:

Check the version of node at the terminal. 
$ node --version
v8.11.1

$ npm --version

5.6.0


The minimum version required to install angular applications is version 6.9. So we can proceeed with installing Angular CLI.

Angular CLI is a Command Line Interface which we use to create a new angular project.It:
generates the boiler plate code
creates deployable packages

To install angular cli. At the command prompt:

$ npm install -g @angular/cli
/home/ubuntu/.nvm/versions/node/v8.11.1/bin/ng -> /home/ubuntu/.nvm/versions/node/v8.11.1/lib/node_modules/@angular/cli/bin/ng
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/@angular/cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ @angular/cli@6.2.3
added 242 packages in 23.945s

Now to check if the installation was successful. At the command prompt:

$ ng --version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 6.2.3
Node: 8.11.1
OS: linux x64
Angular: 
... 

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.8.3
@angular-devkit/core         0.8.3
@angular-devkit/schematics   0.8.3
@schematics/angular          0.8.3
@schematics/update           0.8.3
rxjs                         6.2.2
typescript                   2.9.2
    





No comments:

Post a Comment