【问题标题】:How to avoid node-gyp rebuild when running yarn install?运行 yarn install 时如何避免 node-gyp 重建?
【发布时间】:2019-11-02 22:51:41
【问题描述】:

当我运行yarn install 时,我的原生插件总是会重新构建。可以看出运行命令node-gyp rebuild而不是node-gyp build,即使没有更新。

caros@ubuntu:~/Developer/xviz-converter$ yarn install
yarn install v1.16.0
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
$ node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@10.16.0 | linux | x64
gyp info spawn /usr/bin/python2
....

如何让纱线运行node-gyp build 而不是node-gyp rebuild?完全重建非常耗时。

【问题讨论】:

    标签: node.js yarnpkg node-gyp rebuild node-addon-api


    【解决方案1】:

    您可以运行安装命令并忽略脚本。 请注意,这可能会破坏其他库。

    yarn install --ignore-scripts
    

    https://classic.yarnpkg.com/en/docs/cli/install/#toc-yarn-install-ignore-scripts

    不要执行项目 package.json 及其依赖项中定义的任何脚本。

    【讨论】:

      猜你喜欢
      • 2021-12-14
      • 2012-08-20
      • 2018-02-07
      • 2015-03-28
      • 2018-11-29
      • 2014-12-04
      • 2015-09-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多