Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

178
Views
lerna | right way to install external package on multiple projects

we are using Lerna to manage our mono-repo projects, and I wish to know the best way to install an external package in my projects and ensure that all of them are using the same version.

my project structure (my-Main-A and my my-Main-B both use my-common):

  • my-Main-A
    • my-common
  • my-Main-B
    • my-common

should I install my external package at the common project and export it from there?

import joi from "joi";

export {joi};

and than import it to the other project:

import {joi} from my-common;

or should I install it on all of the 3 projects?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I faced a similar case and I went with adding the library to all of my packages and used --exact to get the package exact same version

If you want to add a library to a package then exported from there, your shared package should be dependent on all other packages and you have to link it with other packages

# add package "a" to multiple packages
lerna add a --scope=b --scope=c --scope=d  --exact
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!