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 proxycnpm 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···)