Install deps above WORKDIR so no root-owned node_modules lands in the checkout #60
Reference in New Issue
Block a user
Delete Branch "node-modules-ownership"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
node_modules/appeared in the checkout as an empty root-owned directory: the daemon created it as the mountpoint for compose.override.yml's- /app/node_modulesanonymous volume, which existed only to stop.:/appshadowing the image's deps.Re-owning it is not possible — the daemon creates a missing mount destination as root whatever user the container runs as (
--user 1000:1000still yields root). So the volume goes: deps now install to/node_modules, one level aboveWORKDIR /app, and Node resolves bare specifiers upward. Nothing to shadow, nothing to mount, and the stale-on-dep-bump anonymous volume goes with it.Fallout handled:
icons.test.tsresolves lucide-static by specifier instead of<repo>/node_modules; README'snpm installnow runs--package-lock-only --user \"$(id -u):$(id -g)\"so it cannot recreate the problem;src/compose.test.tslocks the invariant.Local
bash ci.shis ALL GREEN.