yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.37k stars 2.72k forks source link

Error: EACCES: permission denied, open '/app/.yarnrc' #9002

Open bxdadwhal opened 8 months ago

bxdadwhal commented 8 months ago

My docker file looks like this :- dockerfile: | FROM node:lts WORKDIR /app COPY . . RUN find /app -type f -name .yarnrc -execdir chmod 644 {} \; RUN ls -la WORKDIR /app/destiny/ RUN ls -la RUN rm -rf node_modules RUN yarn install RUN ls -la node_modules RUN yarn build RUN ls -la ENV HOST 0.0.0.0 EXPOSE 3000 CMD ["sh", "-c", "yarn dev"]

I was getting this error :- image

Then I updated my docker file like this :- dockerfile: | FROM node:lts WORKDIR /app COPY . . RUN find /app -type f -name .yarnrc -execdir chmod 644 {} \; RUN ls -la WORKDIR /app/destiny/ RUN chmod -R 644 . RUN chmod 644 .* RUN ls -la RUN rm -rf node_modules RUN yarn install RUN ls -la node_modules RUN yarn build RUN ls -la ENV HOST 0.0.0.0 EXPOSE 3000 CMD ["sh", "-c", "yarn dev"]

Now i am getting this error :- image

Not able to skip this error :- ( React UI container is not coming up and going in crashloopbackoff )

Error: EACCES: permission denied, open '/app/.yarnrc' at Object.openSync (node:fs:603:3) at readFileSync (node:fs:471:35) at /opt/yarn-v1.22.19/lib/cli.js:97395:58 at Array.map () at parseRcPaths (/opt/yarn-v1.22.19/lib/cli.js:97393:78) at Object.findRc (/opt/yarn-v1.22.19/lib/cli.js:97407:10) at getRcConfigForCwd (/opt/yarn-v1.22.19/lib/cli.js:56965:74) at /opt/yarn-v1.22.19/lib/cli.js:88756:56 at Generator.next () at step (/opt/yarn-v1.22.19/lib/cli.js:310:30)