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)
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:
4, use ng to view after success
ng version
shown as:
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:
Then, our Angular CLI environment configuration is configured
View official introduction
1. Regarding npm installation of Angular CLI
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 .
Use cnpm to install Angular CLI and use Taobao mirror to open
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