首页 > V2EX > V2EX-最近换代理软件后没法玩 Node 了,各位大佬是怎么解决 npm 挂代理的问题的
2022
11-25

V2EX-最近换代理软件后没法玩 Node 了,各位大佬是怎么解决 npm 挂代理的问题的

ChrisFreeMan:

目前遇到的问题是在设置代理的情况下,npm install 命令一直失败,原因找了下貌似是 https 连接的问题,
我是通过.zshrc 文件来指向本地的代理地址,通过这个地址指向我的 ss 代理。

以下是设置其一

export http_proxy="http://127.0.0.1:1087"
export https_proxy="http://127.0.0.1:1087"

第二种设置是指向 socks5 本地地址,然后都失败了。

curl 和 brew 命令都正常。

目前唯一有用的方法是将 npm 的仓库地址指向为 http 地址

npm config set registry http://registry.npmjs.org

虽然可以用,但是每次安装包都会发出警告⚠️,这就很烦了,大佬们是怎么搞定的。

npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/
npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/

from V2EX-最新主题 https://ift.tt/zJF5NpA

最后编辑:
作者:分享菌
这个作者貌似有点懒,什么都没有留下。

留下一个回复