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

279
Visualizações
Lerna error: cannot find module during CI build

I have a monorepo using Lerna that I trying to build with Gitlab CI. Running lerna run build locally builds everything successfully.

The Dockerfile that Gitlab tries to execute looks a bit like this:

FROM node:16 AS common
WORKDIR /usr/src/app
RUN yarn global add lerna
COPY . . 

RUN lerna bootstrap --include-dependencies
RUN lerna link

RUN yarn

# yarn build === lerna run build
RUN yarn build

Which results in the following errors:

Cannot find module '@project/common' or its corresponding type declarations.
import { SomeClass } from '@project/common';

Is there any step I am missing? Thanks in advance!

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

I was able to fix this issue by changing the Dockerfile. Running yarn before running lerna bootstrap and removing yarn build resolved the errors.

My Dockerfile now looks like this:

FROM node:16 AS common
WORKDIR /usr/src/app
RUN yarn global add lerna
COPY . . 

RUN yarn
RUN lerna bootstrap --include-dependencies

I can definitely attribute the errors to my limited knowledge of Lerna, but I hope this answer can still help others with similar issues.

about 4 years ago · Juan Pablo Isaza Relatório

0

What version of lerna is being used locally? Amend your question to include the output of learna info.

yarn global add learna will install the latest version, which currently is v4.0.0.

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