Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

280
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda