fork from mirror-config-china
注:
mirror-config-china
中的配置淘宝源域名已经停止服务了
修改 ./lib/config.js
-
geckodriver-binary-host-mirror
新增 20211027 -
canvas-binary-host-mirror
新增 20211027 -
canvas-prebuilt-binary-host-mirror
新增 20211027 -
swc_binary_site
新增 20211027 -
sharp-dist-base-url
移除 20240613 -
sharp_binary_host
新增 20240613 -
sharp_libvips_binary_host
新增 20240613
node ./index.js
code ~/.npmrc
# 使用执行以下命令即可
npx npm-config-china
为中国内地的Node.js开发者准备的镜像配置,大大提高node模块安装速度。
- 支持Windows和其他操作系统
- 自动配置各个node模块的安装源为淘宝镜像
npm i -g npm-config-china --registry=https://registry.npmmirror.com
# 查看npm配置
npm config list
# 查看环境变量
source ~/.bashrc && env
source ~/.zshrc && env
registry.npmjs.com 镜像URL
npmmirror.com/mirrors 镜像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
文件中
- Canvas
- 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-china --registry=https://registry.npmmirror.com