0

我正在使用 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

4

1 回答 1

2

我相信这发生在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。

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

于 2018-09-28T20:36:45.763 回答