1. Install Node.js
url:https://nodejs.org/en/download/
Select the appropriate version to install
2. Installing the Angularjs CLI
Angular is written in typescript, so install typescript First, then install ANGULARJS-CLI
NPM install-g typescript typings
NPM install-g angular-cli--ignore-scripts
NPM Install
3.build Project
Under the path that requires a build, run NPM install first, and then run NG builds, where you can generate the Dist folder
Tips
Clear NPM cache: NPM Cached clean
View NPM Source: NPM Config Get registry
Temporarily switch NPM source to Taobao source (faster): NPM Config Set registry https://registry.npm.taobao.org
Settings to view npm progress: NPM config set loglevel=http
-----------------------------------------------------------------------
Installing CLI
NPM install-g ANGULAR-CLI
If you have installed a previous version, perform the following command to update:
NPM uninstall-g ANGULAR-CLI
NPM Cache Clean
NPM install-g Angular-cli@latest
Older versions of the CLI used SYSTEMJS and the most recent creation, based on Webpack builds.
Older versions of ANGULAR2 (RC1-RC6) can view update steps
The interesting thing here is that after I uninstall ANGULAR-CLI, a build failed error occurred at the time of installation and finally found the reason that uninstall was not uninstalled cleanly. Go to the global directory to delete the relevant NG files.
Common ng Command
ng New Project-name-Creating a new project, setting it as default
ng build-building/Compiling application
ng test-run unit test
ng e2e-run end-to-end (end-to-end) Test
N G serve-launches a small Web server for managed applications
Ng deploy-out-of-the-go, deployed to GitHub pages or firebase
ng generate component My-comp-generates a new component with Generates its test specification and corresponding Html/css file
ng generate directive my-directive-generate a new instruction
ng generate pipe my-pipe-Generate a new pipeline
NG gene Rate Service My-service-Generate a new server
ng generate route My-route-Generate a new route
Ng generate class My-class-Generate a simple model class