不废话,直接上命令
ELECTRON_MIRROR=https://npm.taobao.org/mirrors/electron/ ELECTRON_CUSTOM_DIR=9.0.5 cnpm i electron
ELECTRON_MIRROR 指定源
ELECTRON_CUSTOM_DIR 指定目录(因为taobao的镜像里面没有版本v 这个字母)
至于npx
可以这样加速
NPM_CONFIG_REGISTRY=https://registry.npm.taobao.org/ npx gltfjsx scene.gltf
2022年4月27日补充
安装sharp慢
npm config set sharp_binary_host "https://npmmirror.com/mirrors/sharp"
npm config set sharp_libvips_binary_host "https://npmmirror.com/mirrors/sharp-libvips"
npm install sharp
enjoy it