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!