Visual Studio 2017使用淘宝镜像的方法

使用VS2017还原NPM包时,因为要访问外网,安装时间特别漫长,而且等待很长时间也可能安装错误

Visual Studio 2017使用淘宝镜像的方法_第1张图片

npm安装

淘宝 NPM 镜像:一个完整 npmjs.org 镜像,你可以用此代替官方版本(只读),同步频率目前为 10分钟 一次以保证尽量与官方服务同步。

安装淘宝镜像

  1. 1 npm config set registry https://registry.npm.taobao.org
  2. 2 npm info underscore
  3. 3 修改VS2017Npm外部配置工具

Visual Studio 2017使用淘宝镜像的方法_第2张图片

Npm配置默认选项

需要添加以下路径
C:\Program Files\nodejs
C:\Users\82511\AppData\Roaming\npm
D:\Program Files\Git\bin

Visual Studio 2017使用淘宝镜像的方法_第3张图片

配置淘宝镜像

再次还原npm,出现如下的安装信息。

PATH=.\node_modules\.bin;%PATH%;d:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd;d:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\mingw32\bin;C:\Program Files\nodejs;C:\Users\82511\AppData\Roaming\npm;D:\Program Files\Git\bin
"C:\Program Files\nodejs\npm.CMD" install
[email protected] E:\COLDDEMO\Vue
+-- @types/[email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
| `-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 

| `-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
| `-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
+-- [email protected] 
| +-- [email protected] 
| `-- [email protected] 
`-- [email protected] 
 `-- [email protected] 
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

Visual Studio 2017使用淘宝镜像的方法_第4张图片

Npm还原成功示意图

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。

你可能感兴趣的:(Visual Studio 2017使用淘宝镜像的方法)