npm修改源

执行

1
npm config set registry https://registry.npmmirror.com

测试

1
npm config get registry

配置 NPM 不做严格的 SSL 校验

1
npm config set strict-ssl false

配置环境变量

1
NODE_TLS_REJECT_UNAUTHORIZED:0

UNABLE_TO_VERIFY_LEAF_SIGNATURE :配置 yarn 不做严格的 SSL 校验

1
yarn config set "strict-ssl" false

SSL certificate problem: unable to get local issuer certificate

配置 Git 不做 SSL 校验。

1
git config --global http.sslVerify false

fatal: unable to connect to github.com

配置 Git 使用 http 代替 https。

1
git config --global url.https://github.com/.insteadOf git://github.com/

在 Linux 非 root 用户下 sudo npm npm 命令执行的 node_module 地址不一样

本文地址 npm修改源

本文地址: https://github.com/maxzhao-it/blog/post/21566/