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

How to configure Angular CLI in Mac environment

一个新手
Release: 2017-09-20 09:40:43
Original
2814 people have browsed it


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
Copy after login

Step 3: Install Angular CLI

cnpm install -g @angular/cli
Copy after login

Step4: Set cnpm as the default package management tool

ng set --global packageManager=cnpm
Copy after login

Step5: Create new angular Project

ng new my-app
Copy after login

Step6: Start the project

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

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      //最后启动工程
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template