【问题标题】:Trouble importing project in lerna在 lerna 中导入项目时遇到问题
【发布时间】:2018-08-31 16:54:03
【问题描述】:

我正在尝试将我的第一个项目导入 lerna 存储库并收到以下错误:

lerna ERR! import Rolling back to previous HEAD (commit a235ee9b3c382c9751abf792a22b2ec9df894a18)
lerna ERR! EIMPORT Failed to apply commit a932c8cf8.
lerna ERR! EIMPORT Command failed: git am -3 --keep-non-patch
lerna ERR! EIMPORT error: Failed to merge in the changes.
lerna ERR! EIMPORT Applying: Made Device Analytics Controller. Made device-analytics.stache be rendered through controller.
lerna ERR! EIMPORT Using index info to reconstruct a base tree...
lerna ERR! EIMPORT M    packages/some-repo/app/scripts/app/controls/active-device.js
lerna ERR! EIMPORT M    packages/some-repo/app/templates/device/active-device.stache
lerna ERR! EIMPORT M    packages/some-repo/views/index.jade
lerna ERR! EIMPORT Falling back to patching base and 3-way merge...
lerna ERR! EIMPORT Auto-merging packages/some-repo/app/templates/device/device-analytics.stache
lerna ERR! EIMPORT CONFLICT (add/add): Merge conflict in packages/some-repo/app/templates/device/device-analytics.stache
lerna ERR! EIMPORT Auto-merging packages/some-repo/app/scripts/app/controls/device-analytics.js
lerna ERR! EIMPORT CONFLICT (add/add): Merge conflict in packages/some-repo/app/scripts/app/controls/device-analytics.js
lerna ERR! EIMPORT Auto-merging packages/some-repo/app/scripts/app/controls/active-device.js
lerna ERR! EIMPORT CONFLICT (content): Merge conflict in packages/some-repo/app/scripts/app/controls/active-device.js
lerna ERR! EIMPORT Patch failed at 0001 Made Device Analytics Controller. Made device-analytics.stache be rendered through controller.
lerna ERR! EIMPORT The copy of the patch that failed is found in: .git/rebase-apply/patch
lerna ERR! EIMPORT When you have resolved this problem, run "git am --continue".
lerna ERR! EIMPORT If you prefer to skip this patch, run "git am --skip" instead.
lerna ERR! EIMPORT To restore the original branch and stop patching, run "git am --abort".
lerna ERR! EIMPORT
lerna ERR! EIMPORT
lerna ERR! EIMPORT You may try again with --flatten to import flat history.

如果我使用flatten 标志运行导入命令,我会收到以下错误:

lerna ERR! EIMPORT Failed to apply commit f16ede066.
lerna ERR! EIMPORT Command failed: git am -3 --keep-non-patch
lerna ERR! EIMPORT error: git diff header lacks filename information when removing 1 leading pathname component (line 845968)
lerna ERR! EIMPORT error: could not build fake ancestor
lerna ERR! EIMPORT Applying: Adding dist files. Refs #17
lerna ERR! EIMPORT Patch failed at 0001 Adding dist files. Refs #17
lerna ERR! EIMPORT The copy of the patch that failed is found in: .git/rebase-apply/patch
lerna ERR! EIMPORT When you have resolved this problem, run "git am --continue".
lerna ERR! EIMPORT If you prefer to skip this patch, run "git am --skip" instead.
lerna ERR! EIMPORT To restore the original branch and stop patching, run "git am --abort".

我还在他们的 github repo 上发布了一个问题:https://github.com/lerna/lerna/issues/1644

我应该寻找什么?

提前致谢, 丹

【问题讨论】:

    标签: lerna


    【解决方案1】:

    我已修复此 PR 中的错​​误 - 仅针对 lerna import --flatten <dir> 解决它:

    https://github.com/lerna/lerna/pull/2037

    基本上git log 的彩色输出导致了这个错误。

    如果您的项目需要这个并且 PR 尚未合并(或者如果是,也许您应该升级 lerna),您可以签出 lerna,然后在 PR 中显示的文件中进行更改,然后运行 ​​@987654324 @ 这样你就可以在CLI中执行修改后的版本,然后finally:

    lerna import --flatten <dir>
    

    并且,完成后记得npm unlinklerna。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-12-16
      • 2016-05-13
      • 1970-01-01
      • 2014-11-07
      • 1970-01-01
      • 2022-10-05
      • 2017-07-29
      • 2021-09-03
      相关资源
      最近更新 更多