3

我正在尝试将我的第一个项目导入 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

我应该寻找什么?

在此先感谢,丹

4

1 回答 1

3

我已经修复了此 PR 中的错​​误 - 仅解决了以下问题lerna import --flatten <dir>

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

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

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

lerna import --flatten <dir>

并且,完成后记得npm unlinklerna。

于 2019-04-12T23:09:46.010 回答