Why was /usr/local/lib the defaut local packages destination directory in NodeJS docker image ?
FROM node:24-alpine
WORKDIR app/
COPY package.json yarn.lock ./
RUN corepack enable \
&& corepack prepare yarn@stable --activate \
&& yarn install --immutable \
&& yarn cache clean
RUN ls -l node_modules
You get a "File or directory was not Found" error
A sample Gist project:
find / -name node_modulesreturns/usr/local/lib/node_modules/node_modulesas expected./usr/local/lib/node_modulesexists and just containsnpm.package.json/yarn.lock