勒纳麻烦的进口项目

时间:2018-08-31 16:54:03

标签: lerna

我正在尝试将我的第一个项目导入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标志运行import命令,则会出现此错误:

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存储库上发布了一个问题:https://github.com/lerna/lerna/issues/1644

我应该找什么?

预先感谢, 丹

1 个答案:

答案 0 :(得分:0)

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

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

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

如果您的项目需要此文件,而PR尚未合并(或者如果需要,则应该升级lerna),则可以签出lerna,然后在PR中显示的文件中进行更改,然后运行{{ 1}},因此您可以在CLI中执行修改后的版本,然后最后:

npm link

而且,完成后请记住lerna import --flatten <dir> lerna。