angular-cli安装及build项目

来源:互联网 发布:5g网络 知乎 编辑:程序博客网 时间:2024/05/16 14:12
1.安装Node.js
URL:https://nodejs.org/en/download/
选择合适的版本进行安装


2.安装AngularJS CLI
angular是用typescript编写的,所以先安装typescript,再安装angularjs-cli
npm install -g typescript typings
npm install -g angular-cli --ignore-scripts
npm install


3.build项目
在需要build的路径下,先运行npm install,再运行ng build,即可以生成build后的dist文件夹




tips:
清空npm缓存:npm cache clean
查看npm源:npm config get registry
临时切换npm源为taobao源(速度快一点):npm config set registry https://registry.npm.taobao.org
设置可以查看npm进度:npm config set loglevel=http
0 0