'EPERM: operation not permitted' error when building Nuxt app

Viewed 13290

Getting one of the following intermittant errors when running npm run dev:

EPERM: operation not permitted, mkdir 'D:\projects\my_project\.nuxt\components'

EPERM: operation not permitted, lstat 'D:\projects\my_project\.nuxt

I tried npm cache clear to no avail. Some people attribute this issue to npm install folders shared on some network, not my case.

Note: this is a random issue. I just tried again after a couple hours and now it works. But when creating this question, it never worked no matter how many times I tried.

Any idea?

8 Answers

I had the same issue. I believe is related on VS Code.

I closed VS Code and stopped my console.
I rebuild Nuxt with 'npm run dev' and reopen VS Code.
Now is working.

To solve this issue is only

Stop dev, Close your CMD and Open CMD again and last you can npm run dev again

Hope this will help you :)

Same issue. I'm on windows with VS code. Closed terminal and run again with administrator, then it worked. Permission issue.

first close the vscode and the bash or cmd runner the project then just remove the ".nuxt" directory form root your project

I am using webstorm, and this problem also happened to me. I closed my terminal, then I closed webstrom and opened my IDE again and npm run dev. It solved my problem and maybe it can solves yours.

I was running Nuxt inside Docker, and it seemed that this issue was caused by my Docker images using up all the allotted space.

After cleaning up Docker images and containers, things started working again when I reinstalled.

Edit: Never mind, this issue happens when I change branches with git. Fixing it is simply about restarting Docker.

For me the issue was that the file rights were given to root rather than to my user.

I fixed it using the command:

chown -R <user>:<group> .nuxt

Make sure to replace the <user> and <group>.

In my situation, dev script was already running so it prevented build script to access that directory.

Related