Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node:20.13 breaks building with workspaces from root #2081

Open
tharvik opened this issue May 8, 2024 · 3 comments
Open

node:20.13 breaks building with workspaces from root #2081

tharvik opened this issue May 8, 2024 · 3 comments

Comments

@tharvik
Copy link

tharvik commented May 8, 2024

Environment

  • Platform: GNU/Linux
  • Docker Version: 24.0.5, build ced0996600
  • Node.js Version: 20.13
  • Image Tag: 20.13

Expected Behavior

Building a workspace aware project without changing workdir.

Current Behavior

npm fails stating that it can't find any workspace: "ERR! No workspaces found!"

Possible Solution

setting WORKDIR to another dir than / before running npm fixes it.
also using node:20.12 instead of node:20 (or node:20.13) fixes it.

Steps to Reproduce

FROM node:20.13

RUN echo '{ "name": "root", "workspaces": ["pkg"] }' > package.json
RUN mkdir -p pkg/
RUN echo '{ "name": "pkg" }' > pkg/package.json
RUN npm -ws pkg get name # random workspace aware cmd
@LaurentGoderre
Copy link
Member

Leaving the workdir undefined is the preferred behavior because it's an image that is used as a base for other images. The workdir can easily be set either in a dependent image or at runtime.

@tharvik
Copy link
Author

tharvik commented May 8, 2024

indeed, working around it is quite easy. but I don't see documentation on actively setting the workdir when deriving an image. and it was working in the previous minor version so I see it as a regression on a LTS image, which might break a bunch of setup (it broke mine at least).

@LaurentGoderre
Copy link
Member

It might be a change of behavior in npm that causes this to change within a major version.

PhearZero added a commit to algorandfoundation/liquid-auth that referenced this issue May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants