【问题标题】:npm package from inside another repo?来自另一个仓库的 npm 包?
【发布时间】:2017-06-06 01:07:06
【问题描述】:

相关:Depend on a branch or tag using a git URL in a package.json?

electrode-archetype-react-app npm 包来自另一个包的 git 存储库的子目录:electrode-io/electrodepackages/electrode-archetype-react-app

  1. 这怎么可能?
  2. 如何挂钩子包的特定分支?

我试过了

npm install electrode-io/electrode#electrode-archetype-react-app/some-branch

但出现以下错误:

fatal: ambiguous argument 'electrode-archetype-react-app': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

然后我尝试了

npm install github:electrode-io/electrode#electrode-archetype-react-app/some-branch
npm install github:electrode-io/electrode -- package/electrode-archetype-react-app#some-branch
npm install github:electrode-io/electrode#some-branch -- package/electrode-archetype-react-app

没有骰子

这是什么黑魔法?

编辑感谢一位眼尖的同事:Electrode 正在使用Lerna,这可能是这种黑暗魔法的来源。

【问题讨论】:

    标签: git npm walmart-electrode


    【解决方案1】:

    确实是 Lerna 是 puppet-master,并且不可能使用来自 origin 的远程分支。只能使用相对路径在本地完成。

    【讨论】:

      猜你喜欢
      • 2021-05-01
      • 1970-01-01
      • 2013-09-28
      • 1970-01-01
      • 1970-01-01
      • 2015-09-26
      • 2013-07-20
      • 2013-10-03
      • 1970-01-01
      相关资源
      最近更新 更多