YARN使用阿里云云效私库配置(二进制流解决Postinstall相关依赖包)

1.node版本:

 

 

 2.yarn版本:

 

 

 

 

 

 

3.yarn全局配置 

yarn config set registry "https://registry.npmmirror.com"

 

4.vim /root/.npmrc  和 前端项目下面也需要设置下.npmrc (是隐藏文件) ,两个位置都要写上

 

 

 

5.单独需要的依赖全局安装即可:如 cweb-bin  mozjpeg-bin optipng-bin这都是postinstall需要安装的系统依赖基于c++的

yarn install registry=https://registry.npmmirror.com

6.项目package.json里面添加配置

  "resolutions": {
    "bin-wrapper": "npm:bin-wrapper-china"
  },

7.执行打包

yarn install

 

 

 

 完成ok了

 

posted @ 2022-11-10 14:28  努力乄小白  阅读(656)  评论(0编辑  收藏  举报