Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

183
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda