Search code examples
npmlernamonorepo

Consume specific package and specific version from a monorepo in an external repo


My lerna mono-repo is structured like:

# My mono-repo
├── lerna.json
├── package.json
└── packages
    ├── pck1 (1.0.0)
    └── pck2 (2.0.0) 

I have external-repo that wants to consume just pck2 version 1.0.0 from mono-repo. How would I do that in my package.json?


Solution

  • Looks like I'd need to publish that package to npm(public or internal) with lerna. Then the external-repo just would consume that and be versioned.