如node 用 npm 安装包,需要挂代理才能访问:
命令如下:
export http_proxy=http://127.0.0.1:1080
export https_proxy=http://127.0.0.1:1080
window cmd
set http_proxy=http://127.0.0.1:1080
set https_proxy=127.0.0.1:1080
代理出现:unable to verify the first certificate
可以把npm 或者yarn的ssh关掉
yarn config set "strict-ssl" false -g
npm config set strict-ssl false
参考:
https://github.com/yarnpkg/yarn/issues/980
清除代理
npm config rm proxy
npm config rm https-proxy
yarn config delete proxy
yarn config delete https-proxy