Home  >  Article  >  Web Front-end  >  How to configure Angular CLI in Mac environment

How to configure Angular CLI in Mac environment

一个新手
一个新手Original
2017-09-20 09:40:432789browse


Angular CLI configuration in Mac environment

Step 1: Install nodejs

Download and install nodejs on the nodejs official website

Step 2: Install Alibaba’s npm alternative tool cnpm

npm install -g cnpm --registry=https://registry.npm.taobao.org

Step 3: Install Angular CLI

cnpm install -g @angular/cli

Step4: Set cnpm as the default package management tool

ng set --global packageManager=cnpm

Step5: Create new angular Project

ng new my-app

Step6: Start the project

cd my-app       //进入工程目录
ng serve –open  //启动工程

Enter localhost: 4200 in the browser, and the following picture will be displayed, that is, the service is started

How to configure Angular CLI in Mac environment

Note: If an error is reported in

The “@angular/compiler-cli” package was not properly installed

rm –rf node_modules //删除node_modules
cnpm intall         //重新执行安装模块
ng serve –open      //最后启动工程

The above is the detailed content of How to configure Angular CLI in Mac environment. 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