A collection of nodejs CDN for Celestial Imperial

Living inside of the Great Fire Wall is a so onerous ordeal that survival guides can be compiled into an anthology.

Here is how to configure various popular open source project to use their CDN in Ch******na.

Plenty of nodejs project provide environment variable to configure mirror/CDN to download source code or binary.

nvm / nodejs

Ref

1
NVM_NODEJS_ORG_MIRROR=https://npm.taobao.org/mirrors/node nvm install 4

npm

Ref

1
npm --registry=https://registry.npm.taobao.org install koa

Kudos to fengmk2

PhantomJS

Ref

1
PHANTOMJS_CDNURL=https://npm.taobao.org/dist/phantomjs npm install phantomjs --registry=https://registry.npm.taobao.org --no-proxy

Kudos to fengmk2, again!

node-sass

Ref

1
SASS_BINARY_SITE=https://registry.npmjs.org/node-sass npm install node-sass

Kudos, again and again, to fengmk2

Docker

Ref

Install Docker

1
curl -sSL http://acs-public-mirror.oss-cn-hangzhou.aliyuncs.com/docker-engine/internet | sh -

Config accelerator

You need to register an account in daocloud.io.

1
2
echo "DOCKER_OPTS=\"--registry-mirror=http://xxxxxx.m.daocloud.io\"" | sudo tee -a /etc/default/docker
sudo service docker restart

Kudos to daocloud.

Pypi

Ref

1
2
3
4
cat <~/.pip/pip.conf <<EOF
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
EOF

Kudos to aliyun

sbt

Ref

1
2
3
4
5
6
7
8
9
cat > ~/.sbt/repositories <<EOF
[repositories]
local
osc: http://maven.oschina.net/content/groups/public/
typesafe: http://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly
sonatype-oss-releases
maven-central
sonatype-oss-snapshots
EOF

Kudos to freewind

And these links is useful:
加速 SBT 下载依赖库的速度
how to make sbt jump over GFW

Gopm

Ref

It is quite clear in the doc and help command.

1
2
3
4
5
6
7

gopm get <import path>@[<tag|commit|branch>:<value>]
gopm get <package name>@[<tag|commit|branch>:<value>]

useful options:
--update, -u update package(s) and dependencies if any
--gopath, -g download all packages to GOPATH

Conclusion

Hail Aliyun! Hail fengmk2!
For the unfortunate who live in a crappy ignorant country.

dark
sans