npm || cnpm淘宝镜像 || 网络代理的配置

npm 、cnpm 切换之间的那些事儿

npm 设置默认源

// 1、设置npm源
npm config set registry https://registry.npmjs.org/

// 2、查看源( npm或者cnpm淘宝镜像 )
npm get registry

 npm设置淘宝镜像

// 1、设置淘宝镜像
npm install cnpm -g --registry=https://registry.npm.taobao.org 

// 2、取消淘宝镜像 ( 切换为npm源 )
npm config delete registry

// 3、查看版本
cnpm -v

// 4、安装依赖 ( 安装包可以用 npm 也可以用 cnpm )
cnpm i

npm设置http代理 (使用网络代理时可以用)

// 1、npm/cnpm 设置http代理
npm config set proxy=http://10.1.12.88:8080
cnpm config set proxy=http://10.1.12.88:8080

// 2、取消代理
npm config delete proxy

cnpm config delete proxy

// 3、查看代理信息 && 源(当前配置)
npm config list

 cmd命令中使用http代理

// 使用 http 类型代理
set http_proxy=http://10.1.12.88:8080 (set https_pr···)

// 如果有用户名和密码
set http_proxy_user=jake
set http_proxy_pass=abcd

// 取消http代理
set http_proxy=               (  set https_proxy=  )

// other
// 使用 socks 类型代理
netsh winhttp set proxy proxy-server="socks=127.0.0.1:8484" bypass-list="localhost"
netsh winhttp show proxy
netsh winhttp reset proxy

// 使用 socks 类型代理
set http_proxy=socks5://127.0.0.1:8484 (set https_pr···)

  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值