yarn install --check-files 太慢

server那点事

最近几次部署rails 6.x,部署的时候需要$ yarn install --check-files

有的时候巨慢无比,甚至造成了服务器假死现象,这一过程卡在 Building fresh packages

了解到,这一步就是执行了各个安装了的包裹里的 postinstall 而已。

猜测是因为源在国外的原因,替换为国内镜像源,$vim ~/.yarnrc

registry "https://registry.npm.taobao.org"

sass_binary_site "https://npm.taobao.org/mirrors/node-sass/"
phantomjs_cdnurl "http://cnpmjs.org/downloads"
electron_mirror "https://npm.taobao.org/mirrors/electron/"
sqlite3_binary_host_mirror "https://foxgis.oss-cn-shanghai.aliyuncs.com/"
profiler_binary_host_mirror "https://npm.taobao.org/mirrors/node-inspector/"
chromedriver_cdnurl "https://cdn.npm.taobao.org/dist/chromedriver"

发表于 2019.11.11