在项目根目录下创建.yarnrc
文件,内容如下
registry "https://registry.npm.taobao.org"
sqlite3_binary_host_mirror "https://foxgis.oss-cn-shanghai.aliyuncs.com/"
profiler_binary_host_mirror "https://npm.taobao.org/mirrors/node-inspector/"
NODEJS_ORG_MIRROR: "https://npm.taobao.org/mirrors/node"
NVM_NODEJS_ORG_MIRROR: "https://npm.taobao.org/mirrors/node"
NVM_IOJS_ORG_MIRROR: "https://npm.taobao.org/mirrors/iojs"
PHANTOMJS_CDNURL: "https://npm.taobao.org/mirrors/phantomjs"
CHROMEDRIVER_CDNURL: "https://npm.taobao.org/mirrors/chromedriver"
OPERADRIVER_CDNURL: "https://npm.taobao.org/mirrors/operadriver"
ELECTRON_MIRROR: "https://npm.taobao.org/mirrors/electron/"
ELECTRON_BUILDER_BINARIES_MIRROR: "http://npm.taobao.org/mirrors/electron-builder-binaries/"
SASS_BINARY_SITE: "https://npm.taobao.org/mirrors/node-sass"
SWC_BINARY_SITE: "https://npm.taobao.org/mirrors/node-swc"
FLOW_BINARY_MIRROR: "https://github.com/facebook/flow/releases/download/v"
NWJS_URLBASE: "https://npm.taobao.org/mirrors/nwjs/v"
PUPPETEER_DOWNLOAD_HOST: "https://npm.taobao.org/mirrors"
SENTRYCLI_CDNURL: "https://npm.taobao.org/mirrors/sentry-cli"
npm_config_sharp_binary_host: "https://npm.taobao.org/mirrors/sharp"
npm_config_sharp_libvips_binary_host: "https://npm.taobao.org/mirrors/sharp-libvips"
npm_config_robotjs_binary_host: "https://npm.taobao.org/mirrors/robotjs"
或者安装tbify
(推荐)
npm install tbify --global
参考
tbify