【问题标题】:Why Lerna creates a lot of .tgz files at root project ?为什么 Lerna 在根项目中创建大量 .tgz 文件?
【发布时间】:2018-09-28 15:04:51
【问题描述】:

我正在使用 Lerna,当我使用 lerna publish 时,在我的项目的根目录中创建了很多 .tgz 文件。如何保存要创建的这些文件?感谢您的任何提示。

这里是我的项目根目录:

28/09/2018 16:25 99 847 hoco_editor-alignment_plugin-1.1.0.tgz 28/09/2018 16:58 100 183 hoco_editor-alignment_plugin-1.2.0.tgz 28/09/2018 16:25
102 772 hoco_editor-bold_plugin-1.1.0.tgz 28/09/2018 16:58
102 875 hoco_editor-bold_plugin-1.2.0.tgz 28/09/2018 16:25
1 299 hoco_editor-embed_plugin-1.1.0.tgz 28/09/2018 16:58
1 507 hoco_editor-embed_plugin-1.2.0.tgz 28/09/2018 16:25
4 072 hoco_editor-font_family_plugin-1.1.0.tgz 28/09/2018 16:58
4 257 hoco_editor-font_family_plugin-1.2.0.tgz 28/09/2018 16:25
4 281 hoco_editor-font_size_plugin-1.1.0.tgz 28/09/2018 16:58
4 465 hoco_editor-font_size_plugin-1.2.0.tgz 28/09/2018 16:25
2 128 hoco_editor-image_plugin-1.1.0.tgz 28/09/2018 16:58
2 317 hoco_editor-image_plugin-1.2.0.tgz 28/09/2018 16:25
2 221 hoco_editor-italic_plugin-1.1.0.tgz 28/09/2018 16:58
2 412 hoco_editor-italic_plugin-1.2.0.tgz 28/09/2018 16:25
1 332 hoco_editor-link_plugin-1.1.0.tgz 28/09/2018 16:58
1 537 hoco_editor-link_plugin-1.2.0.tgz 28/09/2018 16:25
653 hoco_editor-list_plugin-1.1.0.tgz 28/09/2018 16:58
866 hoco_editor-list_plugin-1.2.0.tgz 28/09/2018 16:25
657 hoco_editor-toggle_readonly-1.1.0.tgz 28/09/2018 16:58
873 hoco_editor-toggle_readonly-1.2.0.tgz 28/09/2018 16:25
5 146 hoco_editor-ui-1.1.0.tgz 28/09/2018 16:58 5 332 hoco_editor-ui-1.2.0.tgz

【问题讨论】:

    标签: npm terminal lerna


    【解决方案1】:

    我相信当npm publish 失败并且lerna 没有清理npm pack 生成的压缩包时会发生这种情况。 如果您深入了解 lerna 的源代码,请查看:

    https://github.com/lerna/lerna/blob/5da13190852897ac37349a28a0b24470ec7bd833/utils/npm-publish/npm-publish.js#L40

    基本上是这样的:

    return ChildProcessUtilities.exec(npmClient, args, opts).then(() =>
        // don't leave the generated tarball hanging around after success
        fs.remove(path.join(pkg.location, pkg.tarball.filename)).then(() => pkg)
      );
    

    所以如果 npm(或 yarn)发布失败,tarball 不会被删除。

    您可以安全地删除这些文件,因为它们只是发布过程的临时工件,一开始就不应该存在。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-02-18
      • 1970-01-01
      • 2014-08-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-10
      • 2017-01-27
      相关资源
      最近更新 更多