Lerna: How to install a sub-package of a forked lerna repository as a node dependency?

Created on 6 May 2019  路  2Comments  路  Source: lerna/lerna

which could maybe not releate lerna.but i am curious how should do.
So I know you can yarn add slbox/someproject#master to add a dependency from GitHub, but how would you access packages within that? For example, a lerna project that looks like this:

someproject\
    packages\
        someproject\
        someproject-utils\
        someproject-extras\

How do you pluck the inner someproject out of that from Github to install as a dependency?

orgin question

Most helpful comment

Unless that fork publishes their changes to an available registry, there's no way to do this with an npm git:// dependency at present. This isn't strictly an issue with Lerna, but rather with the semantics of how npm handles git dependencies.

All 2 comments

@woodgear If you want to fork, you can clone the repo locally and remove the .git repo, make any changes you want to your package.json files and follow with lerna bootstrap. You can use lerna import if you want to import the git history. You will likely have to use --flatten.

Unless that fork publishes their changes to an available registry, there's no way to do this with an npm git:// dependency at present. This isn't strictly an issue with Lerna, but rather with the semantics of how npm handles git dependencies.

Was this page helpful?
0 / 5 - 0 ratings