一、首先需要安装nodenpm

  查看你的node以及npm版本:

  node -v 查看node版本

  npm -v 查看npm版本

  要求所有版本都是最新的,不然可能会出错。

  设置淘宝镜像,这样下载东西就是从国内网站下载了,网速更快

 

npm configset registry https://registry.npm.taobao.org

 

二、安装typescript和typings

npm install -g typescript typings

三、安装angular-cli

npm install -g [email protected]

 安装完成后,ng -v 出现以下界面说明安装成功了

Angular-cli 搭建项目

 

 

四、如果你之前安装失败过,最好在安装angular-cli之前先卸载干净,用以下命令

 npm uninstall -g angular-cli
 npm cache clean

五、如果出现node-sass解析失败问题,用淘宝镜像安装cnpm。安装完node-sass之后再安装angular-cli,就没问题了

npm install -g cnpm --registry=http//:registry.taobao.org
npm install node-sass --save-dev

六、创建项目(-skip-install直接跳过下载)

ng new myapp —skip-install

七、运行项目

cd myapp
npm install
ng serve

Angular-cli 搭建项目

 

相关文章:

  • 2022-12-23
  • 2021-08-15
  • 2022-12-23
  • 2022-12-23
  • 2021-05-10
  • 2021-12-09
  • 2022-12-23
  • 2022-01-15
猜你喜欢
  • 2021-11-20
  • 2022-12-23
  • 2021-12-04
  • 2021-09-30
  • 2021-10-12
  • 2021-09-27
相关资源
相似解决方案