# Node Package 镜像
# .yarnrc
配置
@scope:registry 配置自定义的源
registry "https://registry.npm.taobao.org"
disturl "https://npm.taobao.org/dist"
nvm_nodejs_org_mirror "https://npm.taobao.org/mirrors/node"
NODEJS_ORG_MIRROR "https://npm.taobao.org/mirrors/node"
sass_binary_site "https://npm.taobao.org/mirrors/node-sass"
electron_mirror "https://npm.taobao.org/mirrors/electron"
SQLITE3_BINARY_SITE "https://npm.taobao.org/mirrors/sqlite3"
profiler_binary_host_mirror "https://npm.taobao.org/mirrors/node-inspector"
node_inspector_cdnurl "https://npm.taobao.org/mirrors/node-inspector"
selenium_cdnurl "https://npm.taobao.org/mirrors/selenium"
puppeteer_download_host "https://npm.taobao.org/mirrors"
chromedriver_cdnurl "https://npm.taobao.org/mirrors/chromedriver"
operadriver_cdnurl "https://npm.taobao.org/mirrors/operadriver"
phantomjs_cdnurl "https://npm.taobao.org/mirrors/phantomjs"
fse_binary_host_mirror "https://npm.taobao.org/mirrors/fsevents"
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# .npmrc
@scope:registry 配置自定义的源
代理配置 npm config set proxy npm config set https-proxy
registry="https://registry.npm.taobao.org"
disturl="https://npm.taobao.org/dist"
nvm_nodejs_org_mirror="https://npm.taobao.org/mirrors/node"
nodejs_org_mirror="https://npm.taobao.org/mirrors/node"
sass_binary_site="https://npm.taobao.org/mirrors/node-sass"
electron_mirror="https://npm.taobao.org/mirrors/electron/"
SQLITE3_BINARY_SITE="https://npm.taobao.org/mirrors/sqlite3"
profiler_binary_host_mirror="https://npm.taobao.org/mirrors/node-inspector/"
node_inspector_cdnurl="https://npm.taobao.org/mirrors/node-inspector"
selenium_cdnurl="https://npm.taobao.org/mirrors/selenium"
puppeteer_download_host="https://npm.taobao.org/mirrors"
chromedriver_cdnurl="https://npm.taobao.org/mirrors/chromedriver"
operadriver_cdnurl="https://npm.taobao.org/mirrors/operadriver"
phantomjs_cdnurl="https://npm.taobao.org/mirrors/phantomjs"
fse_binary_host_mirror="https://npm.taobao.org/mirrors/fsevents"
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 资源
- Node.js, npm Mirrors https://npm.taobao.org/mirrors/ (opens new window)
- 国内镜像源整理 | 前端开发者说 https://huixisheng.github.io/%2Fmirror%2F (opens new window)
- i5ting/yrm: YARN registry manager, fast switch between different registries: npm, cnpm, nj, taobao https://github.com/i5ting/yrm (opens new window)
- Pana/nrm: NPM registry manager, fast switch between different registries: npm, cnpm, nj, taobao https://github.com/Pana/nrm (opens new window)
# 常见问题解决办法
- 解决 node-gyp rebuild 时的假死问题 - 风の愿 https://breeswish.org/blog/2014/11/14/node-gyp-rebuild-freeze/ (opens new window)
- envvars | Yarn https://yarnpkg.com/en/docs/envvars (opens new window)
- mapbox/node-pre-gyp: Node.js tool for easy binary deployment of C++ addons https://github.com/mapbox/node-pre-gyp#download-binary-files-from-a-mirror (opens new window)
- 安装依赖时遇到
node-gyp
权限的问题可以加上--unsafe-perm
配置 gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/4.2.2" · Issue #405 · nfarina/homebridge https://git.io/fjjy5 (opens new window) - NPM添加二进制文件镜像地址 – 奔霸 https://www.runjf.com/nodejs/npm-add-binary-mirror (opens new window)
npm view node-pre-gyp
- 搭建 NPM Proxy 之预编译包 - WAYJAM https://wayjam.me/post/internal-npm-proxy-prebuild-package.md (opens new window)
- gucong3000/mirror-config-china: Mirrors in China about node.js https://github.com/gucong3000/mirror-config-china (opens new window)
# 镜像资源
- RubyGems 镜像 - Ruby China https://gems.ruby-china.com/ (opens new window)
- 阿里巴巴开源镜像站 https://opsx.alibaba.com/mirror (opens new window) 试用了下感觉效果还不错
- 欢迎访问网易开源镜像站 http://mirrors.163.com/ (opens new window)
- 清华大学开源软件镜像站 | Tsinghua Open Source Mirror https://mirrors.tuna.tsinghua.edu.cn/ (opens new window)
- 华为开源镜像站_软件开发服务_华为云 https://mirrors.huaweicloud.com/ (opens new window)
- 腾讯软件源 https://mirrors.cloud.tencent.com/ (opens new window)
- 国内开源镜像站点汇总 chinese-opensource-mirror-site: 国内开源镜像站点汇总 https://gitee.com/gsls200808/chinese-opensource-mirror-site (opens new window)
- 国内镜像源整理 | 前端开发者说 https://huixisheng.github.io/%2Fmirror%2F (opens new window)
- 阿里云容器镜像服务 https://cr.console.aliyun.com/cn-hangzhou/instances/repositories (opens new window)