Node.js Usage - Archered/war-repository GitHub Wiki

Install latest node.js on PC. Add nodejs root path to path environment.

configuration

config proxy

npm config set proxy http://${id}:${password}@${url} or npm config set proxy http://${url}

install typescript

npm install -g typescript

install @angular/cli

npm install -g @angular/cli@latest

uninstall @angular/cli

npm uninstall -g @angular/cli  
npm cache clean  

make sure delete ng/ng.cmd in \AppData\Roaming\npm\ after uninstall

@angular/cli

ng new PROJECT_NAME  
cd PROJECT_NAME  
ng serve [--host 0.0.0.0 --port 4201 --live-reload-port 49153]  

ng g means ng generate Component
ng g component my-new-component
Directive
ng g directive my-new-directive
Pipe
ng g pipe my-new-pipe
Service
ng g service my-new-service
Class
ng g class my-new-class
Interface
ng g interface my-new-interface
Enum
ng g enum my-new-enum
Module
ng g module my-module

other command

ng build  
ng test  
ng e2e

npm registry(nrm)

install npm registry

npm install -g nrm

list resource

nrm ls

change resource

nrm use eu
Registry has been set to: http://registry.npmjs.eu/

help

nrm help
https://www.concretepage.com/angular-2/angular-2-4-child-routes-and-relative-navigation-example