EPERM: operation not permitted: How to Fix It | SheCodes

System is blocking you · Needs a closer look

EPERM: operation not permitted

Your operating system won’t let this action happen. Try running your terminal as administrator, or check file permissions.

What the error looks like

Error: EPERM: operation not permitted, rename 'node_modules/.cache/tmp'

Why it happens

The operating system is preventing access to a file or operation. Common on Windows when files are locked, or on Mac/Linux with system directories.

How to fix it

  1. On Mac/Linux: try running the command with sudo
  2. On Windows: run the terminal as Administrator
  3. Close any programs that might be using the file
  4. Check file permissions

Ask your AI coding tool to fix it

Paste this prompt into Claude Code, Cursor, Bolt or Lovable, with your own error in place of the example.

I'm getting this error and I need help understanding and fixing it:

```
Error: EPERM: operation not permitted, rename 'node_modules/.cache/tmp'
```

Please:
1. Explain what this error means in plain English
2. Tell me the most likely cause
3. Give me the exact code changes or commands I need to fix it
4. Show me how to prevent this error in the future

Got a different error?

Paste any error into the free Error Decoder and get it explained in plain English, with a fix prompt.

Decode my error

More common errors explained