'pnpm workspace:* dependencies

I have serious trouble installing an partial pnpm monorepo inside a Docker Conatiner. The problem is that docker build fails at some devDependencieswhich should not even be installed.

  "devDependencies": {
    "@types/node": "17.0.12",
    "@types/ssh2-sftp-client": "7.0.0",
    "dotenv": "14.3.2",
    "eslint": "8.7.0",
    "ts-node": "10.4.0",
    "typescript": "4.5.5",
    "@tts-tmc/eslint-config-typescript": "workspace:*",
    "@tts-tmc/ts-config": "workspace:*"
  }

in my Dockerfile I use fetch to get all dependencies

FROM node:14-alpine
ARG GITHUB_NPM_REGISTRY_TOKEN

RUN npm i -g pnpm
RUN mkdir -p /usr/app
# pnpm fetch does require only lockfile
COPY package.json bin/pnpm-lock.yaml /usr/app/
COPY bin/.npmrc /usr/app/.npmrc
WORKDIR /usr/app
RUN pnpm install -r --offline --prod

but even tho ony --prod dependencies should be installed, docker can't build correctly due to the following error

ERR_PNPM_NO_MATCHING_VERSION_INSIDE_WORKSPACE  In : No matching version found for @tts-tmc/eslint-config-typescript@* inside the workspace

So is there a standard way how to solve this? or do I have to modify the package.json and if so, how would you get the correct versions? I thought tha the `lockfile? should be sufficient to install all dependencies.

Regards Mathias



Solution 1:[1]

Try to generate a dedicated lockfile for your project. Install @pnpm/make-dedicated-lockfile and run make-dedicated-lockfile in /usr/app.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Zoltan Kochan