Open
Description
Version
v20.14.0
Platform
macOS
Subsystem
No response
What steps will reproduce the bug?
Dockerfile:
FROM node:lts as base
...
RUN yarn install --immutable --immutable-cache
...
RUN yarn build
...
CMD yarn start
repro steps:
- run command
docker build -t test-image .
and image should be built without error - run command
docker run -p 3000:3000 test-image
and it leads to error
error This project's package.json defines "packageManager": "yarn@3.5.0". However the current global version of Yarn is 1.22.22.
Presence of the "packageManager" field indicates that the project is meant to be used with Corepack, a tool included by default with all official Node.js distributions starting from 16.9 and 14.19.
Corepack must currently be enabled by running corepack enable in your terminal. For more information, check out https://yarnpkg.com/corepack.
How often does it reproduce? Is there a required condition?
It is 100% reproducible with node v20.14.0 (latest LTS). After pinned node version to 18.20.3, the issue is gone.
I've tried lower version of node 20 like 20.9.0 and it has the same issue.
FROM node:18.20.3 as base
What is the expected behavior? Why is that the expected behavior?
The docker run command should not error out.
What do you see instead?
running command docker run -p 3000:3000 test-image
leads to error:
error This project's package.json defines "packageManager": "yarn@3.5.0". However the current global version of Yarn is 1.22.22.
Presence of the "packageManager" field indicates that the project is meant to be used with Corepack, a tool included by default with all official Node.js distributions starting from 16.9 and 14.19.
Corepack must currently be enabled by running corepack enable in your terminal. For more information, check out https://yarnpkg.com/corepack.
Additional information
No response
Metadata
Metadata
Assignees
Labels
No labels