配置命令
npm config set registry https://git.hubproxy.top/npm/ pnpm config set registry https://git.hubproxy.top/npm/ yarn config set registry https://git.hubproxy.top/npm/ # .npmrc registry=https://git.hubproxy.top/npm/
安装命令示例
npm install react --registry=https://git.hubproxy.top/npm/ pnpm add @vue/compiler-sfc --registry=https://git.hubproxy.top/npm/ yarn add lodash@4.17.21 --registry https://git.hubproxy.top/npm/
注意事项
- 代理官方 registry.npmjs.org 公开包。
- 不支持私有包和需要登录的 scope。
- 如果需要恢复官方源,可以重新设置 registry 为 https://registry.npmjs.org/。