node.js - 勒纳致命 : ambiguous argument 'origin/heads/origin/master...heads/origin/master' : unknown revision or path not in the working tree

标签 node.js git jenkins ssh lerna

这是我关于如何让 lerna 在 Jenkins 中运行的一系列问题的一部分。

上一期:

lerna publish on Jenkins "git remote update" Fails "Could not read from remote repository."

> lerna publish --yes --cd-version=patch

lerna info version 3.0.0-beta.17
lerna info versioning independent
lerna ERR! Error: Command failed: git rev-list --left-right --count origin/heads/origin/master...heads/origin/master
lerna ERR! fatal: ambiguous argument 'origin/heads/origin/master...heads/origin/master': unknown revision or path not in the working tree.
lerna ERR! Use '--' to separate paths from revisions, like this:
lerna ERR! 'git <command> [<revision>...] -- [<file>...]'
lerna ERR! 
lerna ERR! 
lerna ERR!     at makeError (/var/lib/jenkins/workspace/abide/node_modules/@lerna/child-process/node_modules/execa/index.js:169:9)
lerna ERR!     at Function.module.exports.sync (/var/lib/jenkins/workspace/abide/node_modules/@lerna/child-process/node_modules/execa/index.js:338:15)
lerna ERR!     at Object.execSync (/var/lib/jenkins/workspace/abide/node_modules/@lerna/child-process/index.js:21:16)
lerna ERR!     at Object.isBehindUpstream (/var/lib/jenkins/workspace/abide/node_modules/@lerna/git-utils/index.js:209:48)
lerna ERR!     at PublishCommand.initialize (/var/lib/jenkins/workspace/abide/node_modules/@lerna/publish/index.js:92:24)
lerna ERR!     at Promise.resolve.then (/var/lib/jenkins/workspace/abide/node_modules/@lerna/command/index.js:228:24)
lerna ERR! lerna Command failed: git rev-list --left-right --count origin/heads/origin/master...heads/origin/master
lerna ERR! lerna fatal: ambiguous argument 'origin/heads/origin/master...heads/origin/master': unknown revision or path not in the working tree.
lerna ERR! lerna Use '--' to separate paths from revisions, like this:
lerna ERR! lerna 'git <command> [<revision>...] -- [<file>...]'
lerna ERR! lerna 
lerna ERR! lerna 
npm ERR! code ELIFECYCLE
npm ERR! errno 128
npm ERR! abide@1.0.0 publish: `lerna publish --yes --cd-version=patch`
npm ERR! Exit status 128
npm ERR! 
npm ERR! Failed at the abide@1.0.0 publish script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /var/lib/jenkins/.npm/_logs/2018-04-24T05_32_38_890Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 128
npm ERR! abide@1.0.0 jenkins: `npm run versions && npm run test && npm run publish`
npm ERR! Exit status 128
npm ERR! 
npm ERR! Failed at the abide@1.0.0 jenkins script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /var/lib/jenkins/.npm/_logs/2018-04-24T05_32_38_901Z-debug.log

最佳答案

您必须在 monorepo 中进行初始提交才能使其正常工作。您还需要有一个干净的工作树:

$ git add *
$ git commit -m "bootstrap lerna"

如果您输入 git rev-parse HEAD,该错误也会在存储库中发生。第一次提交后,您会发现这不再失败。

关于node.js - 勒纳致命 : ambiguous argument 'origin/heads/origin/master...heads/origin/master' : unknown revision or path not in the working tree,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49994148/

相关文章:

javascript - Azure事件中心Azure功能 Node js集成不起作用

javascript - 如何让机器人在 react 后发送消息到另一个 channel | Discord.js

javascript - 使用 neo4j-javascript 驱动程序时, Node 有附加键

git - 如何从Jenkins多分支管道进行Git和Docker标记

GitHub Api 检查 protected 分支上的批准数量

java - 无法获取在 Jenkins 中发送电子邮件的罪魁祸首列表

node.js - "Cannot GET/"使用nodejs + laravel

git - 我如何在 git 中请求一个分支的完整差异?

hudson - Jenkins 构建被删除

docker - 如何指定在 Jenkinsfile 中安装了 docker 的节点类型?