为中国内地的Node.js开发者准备的镜像配置,大大提高node模块安装速度。
- 支持Windows和其他操作系统
- 自动配置各个node模块的安装源为淘宝镜像
npm i -g mirror-config --registry=https://registry.npmmirror.com
# 查看npm配置
npm config list
# 查看环境变量
source ~/.bashrc && env
registry.npmjs.com 镜像URL
cdn.npmmirror.com/binaries 镜像URL,会覆盖下文中的{bin-mirrors}
mirrors.tuna.tsinghua.edu.cn 镜像URL,会覆盖下文中的{apt-mirrors}
mirrors.aliyun.com 镜像URL,会覆盖下文中的{ali-mirrors}
阿里云ECS VPC或经典网络用户请分别使用http://mirrors.cloud.aliyuncs.com
或http://mirrors.aliyuncs.com
代替
nodejs.org/dist 镜像URL
iojs.org/dist 镜像URL
github.com/npm/npm/releases 镜像URL
GitLab Runner APT镜像URL
Docker社区版 APT镜像URL
GitLab社区版 APT镜像URL
VirtualBox APT镜像URL
NodeJS APT镜像URL前缀
其他参数将被写入.npmrc
文件中
- ChromeDriver
- Electron
- git-win
- node-gyp
- node-inspector
- node-sass
- node-sqlite3
- nodegit
- nodist
- nvm-windows
- nvm
- OperaDriver
- phantomjs
- Puppeteer
- selenium-standalone
- windows-build-tools
cd ~/my-project
mirror-config --registry=https://registry.npmmirror.com
RUN npm config set registry https://registry.npmmirror.com && npm install --unsafe-perm -g mirror-config
RUN npm ci