编码环境配置

powershell相关

设置代理

设置代理:

$env:HTTP_PROXY="http://127.0.0.1:7890"
$env:HTTPS_PROXY="https://127.0.0.1:7890" 

删除代理:

$env:HTTP_PROXY=""
$env:HTTPS_PROXY="" 

npm相关

安装npm

在Node.js中文网下载安装最新版本安装包并安装。

网址:Node.js 中文网 (nodejs.cn)

npm设置代理

设置代理:

npm config set proxy="http://127.0.0.1:7890"
npm config set https-proxy="http://127.0.0.1:7890"

删除代理:

npm config delete proxy 
npm config delete https-proxy

npm设置源站(可选)

npm config set registry https://registry.npmmirror.com/
npm config set registry https://registry.npmjs.org/

yarn相关

安装yarn

npm install -g yarn

yarn设置代理

设置代理:

yarn config set proxy http://127.0.0.1:7890
yarn config set https-proxy http://127.0.0.1:7890

删除代理:

yarn config delete proxy
yarn config delete https-proxy

yarn设置源站(可选)

yarn config set registry https://registry.npmmirror.com/
yarn config set registry https://registry.npmjs.org/

参考资料

设置npm和yarn的代理和registry - 知乎 (zhihu.com)

windows powershell配置http代理_powershell 访问 http-CSDN博客

Last modification:December 20, 2023
如果觉得我的文章对你有用,请随意赞赏~