栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

如何为Windows 7安装angular-cli

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

如何为Windows 7安装angular-cli

在Windows 7 Professional SP 1 64位上安装NodeJs,npm,Typescript,AngularJS,@ angular
/ cli:

因为只有在“痛苦”的搜索之后,我才发现许多有价值的提示散布在各个帖子上,所以这里是一个紧凑的汇编(不是我的想法,而是我的经验)。希望能帮助到你。

  1. 安装Node.js Windows Installer 64位:https : //nodejs.org/en/download/ node-v6.11.0-x64.msi

  2. 如果有(公司代理)(在防火墙后面安装):针对公司代理配置npm:打开cmd窗口(未提升,通常您必须是登录用户)

npm
config设置代理http://Proxy.Company.com:Port(用您的代理设置替换Proxy.Company.com:Port)

npm config设置https-proxy
http://Proxy.Company.com:Port(用您的代理设置替换Proxy.Company.com:Port)

提示:两项设置都是必需的,请向管理员询问正确的URL。如果您需要传播用户/密码,请使用以下语法:

npm config设置代理http://
user:pass@Proxy.Company.com:Port

  1. 设置软件包的npm目录(npm 3.10.10随Node.js一起提供,但我们稍后会更新):

npm配置设置注册表https://registry.npmjs.org/

  1. 将npm更新到最新版本:

npm安装npm @ latest -g

注意:npm
update仅适用于HTTPS变体(注册表https://registry.npmjs.org/)。使用HTTP设置(请参见下文),您将获得“
shasum检查失败”的信息。

  1. 将软件包的npm目录设置为非HTTPS变量:

npm配置设置注册表http://registry.npmjs.org/

原因:https-variant是更新npm本身所必需的,它不适用于所有软件包,例如@ angular / cli @ latest或angular-
cli或typescript @ latest。

  1. 安装Typescript:

npm install -g typescript @ latest

  1. 可能将Visual Studio 2015更新到Update 3(必要)(一切都可以与Community Edition Update 3一起正常使用):Microsoft Visual Studio Professional 2015版本14.0.25422.01更新3 Microsoft .NET framework版本4.6.01055

  2. 确保Visual Studio提取实际安装的软件包:工具/选项,左树/项目和解决方案/外部Web工具,右面板,将$(PATH)条目移到顶部($(DevEnvDir)条目上方)。然后关闭Visual Studio。

  3. 安装AngularJS:

npm install angular(我的版本:1.6.5)

  1. 安装Angular命令行工具:npm install -g @ angular / cli @ latest(@ angular / cli是angular-cli的新名称)

  2. 检查版本(在cmd窗口中;下面是我的版本):

节点-v => v6.11.0

npm -v => 5.1.0

tsc -v => 2.4.1

ng –version => 1.2.0(@ angular / cli)

  1. 为Visual Studio安装可选的软件包安装程序(另请参见下面的“链接”部分):https : //marketplace.visualstudio.com/items?itemName=MadsKristensen.PackageInstaller(… Downloads Package Installer v2.0.101.vsix)

如果出现问题,请执行以下步骤重新启动:

  • 在C: Users AppData Roaming中,删除目录’npm’
  • 在cmd窗口中:npm cache clean或可能:npm cache clean –force
  • 在修复模式下运行node-v6.11.0-x64.msi
  • 继续项目(2.)。

链接:

  • https://visualstudiomagazine.com/articles/2017/04/01/set-up-aspnet-mvc.aspx
  • https://hassantariqblog.wordpress.com/2016/10/08/angular2-using-angular2-with-typescript-for-asp-net-mvc-in-visual-studio-2015/
  • https://www.preproject.com/Articles/1164014/Kick-Start-with-AngularJS-and-Visual-Studio
  • http://www.fladi.de/2014/02/06/howto-npm-hinter-einem-proxy-verwenden/


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/636279.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号