[Angular] Angular8 development Pinduoduo-Angular CLI environment configuration

Environment configuration of Angular CLI

Foreword: Angular8 develops Pinduoduo webapp from basic to actual combat
Prepare one: Angular CLI environment configuration
step: node -> NPM / CNPM -> Angular CLI

Install node.js

1. Log in to the Node.js page: https://nodejs.org/en/
2. Download LTS (the maintenance time is relatively long)
node.js
Note: The purpose of installing node.js is to use npm to manage the packages that the project depends on

The role and difference between npm and cnpm

npm roleFor details, see: Summary of common functions of npm .

Personal understanding: When doing a huge project, you need a lot of packages, such as three packages abc, package a needs to depend on more packages, package b needs to depend on more packages, and package c needs to depend on more packages. Such a layer is nested one after another, which will cause trouble in the later operation of the project and version upgrade, but you can use npm to download the corresponding package to make it easier to manage later.

cnpmThe functions of cnpm and npm are similar. Due to the network environment (slow network speed or slow download, etc.), cnpm is used as an alternative package management tool.

Install Angular CLI using npm

1. Open the terminal(Windows10 version: lower left corner (input the content you want to search here)-input md-open-a small black screen)

2,Enter the command line node-v to view the version of node

node -v//查看node的版本

Displayed as: (It can indicate that node has been installed)

C:\Users\徐文杰>node -v
v14.5.0

3. Use npm to install Angular CLI

npm install -g @angular/cli

Displayed as:
success
4, use ng to view after success

ng version

shown as:
of

Note: The version of Angular CLI should be the same as the version of the project.

Install Angular CLI using cnpm

Use Taobao mirror to open

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

Shown as:
success
Then, our Angular CLI environment configuration is configured

View official introduction

1. Regarding npm installation of Angular CLI
Official npm
Note: Installation is mainly divided into global installation and local installation, we choose global installation

2. Check the Taobao mirror. You
can check the link: aliyuan.com .
aliyun

Use cnpm to install Angular CLI and use Taobao mirror to open
Taobao mirror
Note: The official view is added here, mainly for me to learn to read official documents

end

Send a word of encouragement:

As long as we have worked hard, we will finally bloom proudly

Guess you like

Origin blog.csdn.net/weixin_46038869/article/details/107781247