Home  >  Article  >  Web Front-end  >  What is Angular CLI and how to install it

What is Angular CLI and how to install it

清浅
清浅Original
2019-03-20 16:00:092602browse

Angular CLI is a command line interface tool used to create projects, add files, etc. It allows developers to build Angular projects faster. To install Angular CLI, you must first install the node and npm environment and then install Angular CLI

What is Angular CLI and how to install it

[Recommended course: Angular Tutorial

What is Angular CLI

Angular1.x versions are collectively called Angular JS, while Angular 2.x and The above versions are collectively called Angular. The 1.x version focuses on web development and does not involve mobile terminals. The 2.x version supports mobile terminals. It has two layers: the application layer and the rendering layer. For example, a component can use different @View modifiers. Modifications can take effect at runtime depending on the running environment.

Angular CLI is a command line interface tool that can be used to create projects, add files, and perform a host of development tasks, such as testing, packaging, and publishing. It makes it easier for developers to build Angular projects

Angular CLI installation steps

(1) First, confirm whether node.js and npm, you can check it with the following command

$ node -v
$ npm -v

The above command is used to display the current node and npm versions. It should be noted that the node version must be higher than 6.9.3, and the npm version must be higher than 3.0.0

(2) Install typescript globally

$ npm install -g typescript

This step can be installed or not, because typescript will be automatically installed when creating a new project (non-global), so here it is also No need to install

(3) Install Angular CLI

$ npm install -g @angular/cli

(4) After installation, if the following interface appears, the installation is successful

$ ng v

    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/
@angular/cli: 1.1.1
node: 7.10.0
os: darwin x64

Note: If it is unsuccessful, you need to uninstall and try again

Summary: The above is the entire content of this article, I hope it will be helpful to everyone.

The above is the detailed content of What is Angular CLI and how to install it. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn