npm 设置端口代理
查看你的代理端口号
- 为npm设置代理端口
$ npm config set proxy http://server:port
$ npm config set https-proxy http://server:port
# 例如
$ npm config set proxy http://127.0.0.1:1087
$ npm i node-saaa
# 删除 http 代理
$ npm config delete proxy
- 如果代理需要认证的话可以这样来设置
$ npm config set proxy http://username:password@server:port
$ npm config set https-proxy http://username:pawword@server:port
本作品采用《CC 协议》,转载必须注明作者和本文链接
本帖由 Galois
于 4年前 加精