Aadesh Dhakal
Aadesh Dhakal

Reputation: 452

EPERM: operation not permitted, open '/app/yarn-error.log' in Windows

So I was going through the docker tutorial and I executed this in my power shell:

docker run -dp 3000:3000 `
-w /app -v "$(pwd):/app" `
node:12-alpine `
sh -c "yarn install && yarn run dev"

But my container exited immediately after running. So after observing the logs, this seems to be the problem:

yarn install v1.22.5
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
error Could not write file "/app/yarn-error.log": "EPERM: operation not permitted, open 
'/app/yarn-error.log'"
error An unexpected error occurred: "EPERM: operation not permitted, mkdir '/app/node_modules'".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

I ran the PowerShell in admin mode, no project files are read-only and in folder properties, user and admin have full control. So why is the problem occurring?

Upvotes: 8

Views: 5208

Answers (1)

KMAHY
KMAHY

Reputation: 48

I fix it by changing the folder right access /app/. It only allowed me to make changes so I change it to allow the access write execute and read to all and it worked, just fine.

So changing the right access of your folder should solved your issue.

Upvotes: 1

Related Questions