最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Install package from lerna-managed monorepo via git URL - Stack Overflow

programmeradmin2浏览0评论

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.

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.

Share Improve this question asked Mar 2, 2018 at 7:35 Max KomarychevMax Komarychev 2,8561 gold badge24 silver badges33 bronze badges 3
  • 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./MY-USERNAME/REPONAME doesn't work, neither does yarn add git://github./MY-USERNAME/REPONAME/packages/PACKAGE-NAME). – Chris Boon Commented Apr 2, 2018 at 17:12
  • Unfortunately no, I didn’t find solution of that. – Max Komarychev Commented Apr 2, 2018 at 20:13
  • Possible duplicate of npm install package from github repo subfolder – jjbskir Commented Mar 12, 2019 at 15:42
Add a ment  | 

2 Answers 2

Reset to default 2

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.

Try GitPkg: https://gitpkg.vercel.app/.

Using sub folders of a repo as yarn/npm dependencies made easy

发布评论

评论列表(0)

  1. 暂无评论