Related: Depend on a branch or tag using a git URL in a package.json?
The electrode-archetype-react-app
npm package comes from a subdirectory of another package's git repository: electrode-io/electrode
→ packages/electrode-archetype-react-app
.
I tried
npm install electrode-io/electrode#electrode-archetype-react-app/some-branch
but got the following error:
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>...]'
So then I tried
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
No dice
What dark wizardry is this?
Edit Thanks to an eagle-eyed colleague: Electrode is using Lerna
, which might be the source of this dark magic.
It was indeed Lerna who was the puppet-master, and it is not possible to use a remote branch from origin. It can only be done locally using a relative path.