为什么Lerna在根项目中创建很多.tgz文件?

时间:2018-09-28 15:04:52

标签: npm terminal lerna

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

这是我的项目根目录:

  

28/09/2018 16:25 99847   hoco_editor-alignment_plugin-1.1.0.tgz 28/09/2018 16:58 100   183 hoco_editor-alignment_plugin-1.2.0.tgz 2018年9月28日16:25
  102772 hoco_editor-bold_plugin-1.1.0.tgz 2018年9月28日16:58
  102875 hoco_editor-bold_plugin-1.2.0.tgz 2018年9月28日16:25
  1299 hoco_editor-embed_plugin-1.1.0.tgz 2018年9月28日16:58
  1 507 hoco_editor-embed_plugin-1.2.0.tgz 28/09/2018 16:25
  4072 hoco_editor-font_family_plugin-1.1.0.tgz 2018年9月28日16:58
  4257 hoco_editor-font_family_plugin-1.2.0.tgz 2018年9月28日16:25
  4281 hoco_editor-font_size_plugin-1.1.0.tgz 2018年9月28日16:58
  4465 hoco_editor-font_size_plugin-1.2.0.tgz 2018年9月28日16:25
  2128 hoco_editor-image_plugin-1.1.0.tgz 2018年9月28日16:58
  2317 hoco_editor-image_plugin-1.2.0.tgz 2018年9月28日16:25
  2 221 hoco_editor-italic_plugin-1.1.0.tgz 28/09/2018 16:58
  2412 hoco_editor-italic_plugin-1.2.0.tgz 28/09/2018 16:25
  1332 hoco_editor-link_plugin-1.1.0.tgz 2018年9月28日16:58
  1537 hoco_editor-link_plugin-1.2.0.tgz 2018年9月28日16:25
  653 hoco_editor-list_plugin-1.1.0.tgz 2018年9月28日16:58
  866 hoco_editor-list_plugin-1.2.0.tgz 2018年9月28日16:25
  657 hoco_editor-toggle_readonly-1.1.0.tgz 2018年9月28日16:58
  873 hoco_editor-toggle_readonly-1.2.0.tgz 2018年9月28日16:25
  5146 hoco_editor-ui-1.1.0.tgz 2018年9月28日16:58 5332   hoco_editor-ui-1.2.0.tgz

1 个答案:

答案 0 :(得分:2)

我相信这会在npm publish失败并且lerna不清理npm pack生成的tarball时发生。 如果您深入研究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。

您可以放心地删除这些文件,因为它们只是发布过程中的临时工件,不应放在首位。

相关问题