18

I am using yarn for my project. My project has a dependency which happened to be a subpackage of larger monorepo maintained by lerna. The subpackage was updated but not published yet and I need that unpublished code. Is there any way to install lerna's subpackage via git url?

Thanks.

Max Komarychev
  • 2,676
  • 1
  • 18
  • 30
  • Did you ever find an answer to this? I have the same issue except in my case the subpackage hasn't been updated - I cloned it and updated myself, but can't figure out how to install my version (`yarn add git://github.com/MY-USERNAME/REPONAME` doesn't work, neither does `yarn add git://github.com/MY-USERNAME/REPONAME/packages/PACKAGE-NAME`). – Chris Boon Apr 02 '18 at 17:12
  • Unfortunately no, I didn’t find solution of that. – Max Komarychev Apr 02 '18 at 20:13
  • Possible duplicate of [npm install package from github repo subfolder](https://stackoverflow.com/questions/39194648/npm-install-package-from-github-repo-subfolder) – jjbskir Mar 12 '19 at 15:42

1 Answers1

1

If your questions is "How do I install a sub-package via git?" then that would be a duplicate of this question, which it sounds like you kind of can do, but it does not look fun. But npm on its own does not support installs of git subdirectories.

A better solution would be either to do a release of the package with a npm beta tag and target it directly in your package.json. Or to set up the lerna project locally and run npm link to use it directly.

jjbskir
  • 5,514
  • 4
  • 28
  • 44