个人小站

npm、yarn设置代理

字数统计: 136阅读时长: 1 min
2022/05/11
1
2
3
npm config set https-proxy socks5://127.0.0.1:7890

yarn config set proxy socks5://127.0.0.1:1080

https-proxy、proxy可以互换,目前没感到差别。

还可以设置镜像源,不过改了之后包的地址也会变,如果涉及到跨区域多人开发的话,最好不要乱动。

1
2
3
4
5
6
7
npm config get registry  // 查看npm当前镜像源

npm config set registry https://registry.npm.taobao.org/ // 设置npm镜像源为淘宝镜像

yarn config get registry // 查看yarn当前镜像源

yarn config set registry https://registry.npm.taobao.org/ // 设置yarn镜像源为淘宝镜像

原文作者:ted423

原文链接:http://ted423.github.io/Code/npm%20yarn%20proxy/

发表日期:May 11th 2022, 9:03:54 pm

更新日期:May 11th 2022, 9:44:53 am

版权声明:本站原创内容(一般是语句不通顺的那种)采用知识共享署名-非商业性使用 4.0 国际许可协议进行许可,转载内容以及不带个人观点的分享不在此例,摘抄有Wiki的内容的文章统一根据Wiki采用 CC BY-SA 3.0

CATALOG