parcel: Parcel 2: EPERM: operation not permitted, rename '...' -> '...'

🐛 bug report

When modifying files, there’s sometimes this error that is thrown:

 Error: EPERM: operation not permitted, rename 'C:devtestdistindex.015b01c3.js.3811495039' -> 'C:devtestdistindex.015b01c3.js'

The error is quite inconsistent.

Software Version(s)
Parcel ^2.0.0-nightly.353
Node v14.3.0
Operating System Windows 10 Pro 1909

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 14
  • Comments: 24 (4 by maintainers)

Most upvoted comments

I suspect that the reason that this happens on Windows only is that using rename or mv to overwrite an existing file works fine on Linux/macOS but causes this error on Windows:

$ ls
a.js b.js
$ mv a.js b.js
$ ls
b.js

It looks like Parcel must be locking onto cache files and then trying to modify them or something like that?

(This issue is about EPERM rename with the dist dir) I think the reason is that Parcel tries to write a bundle to the dist dir multiple times concurrently.

Same issue for me, “🚨 Error: EPERM: operation not permitted, rename”.

  "devDependencies": {
    "@parcel/transformer-sass": "^2.0.0-alpha.3",
    "parcel": "^2.0.0-beta.1",
    "sass": "^1.32.2"
  },
Software Version
parcel ^2.0.0-beta.1
node v14.15.3
npm 6.14.9
os Windows 20H2

Getting this in serve mode, which stops working and requires a restart (edit: as in, Ctrl+C and run it again).

It feels like v2 isn’t ready enough for v1 to be marked deprecated.

Same for me (Windows 10 Home, parcel: ^2.0.0-beta.1). Happens often if i change the HTML file parcel is serving.

Currently I get this every time I change the file, I also deleted the cache and dist folders and restarted parcel, still no luck 😦 Every change after start leads to this error. If I change the content back to the original at start time, the server is building again.

Just in case anyone’s restarting their computer to fix this, I found that closing my terminal and opening a new one fixed the issue. Still annoying tho.

I am still getting this error. Ever since I updated Parcel. This happens regardless of whether I am making changes to html or scss files.

@parcel/compressor-raw: EPERM: operation not permitted, rename 'C:\Users\nicho\Desktop\projects\codecademy\Alpine\dist\index.b10d73a7.css.119072295' ->
'C:\Users\nicho\Desktop\projects\codecademy\Alpine\dist\index.b10d73a7.css'
"devDependencies": {
    "@parcel/transformer-sass": "^2.2.1",
    "parcel": "^2.2.1",
    "sass": "^1.49.7"
  }
<html><body>
Software Version
parcel ^2.2.1
node v17.3.0
npm 8.3.0
os Windows 11 - 21H2
</body> </html>

–no-cache still generates .parcel-cache folder

This is intentional, the cache is also used to send data between threads

Any progress? 😃

I am using 2.0.0-nightly.514 on Windows 10 Command-Line, and the issue still persists. Well, “persists” might be misleading. Sometimes it’s there, sometimes it is not.

the error seems to be gone

For me, adding --no-cache has no effect at all - parcel build nevertheless creates/uses the .parcel-cache/ directory and generates the ‘EPERM’ error, just as without --no-cache. Smells like a bug in itself :''D

Downgrading to 2.0.0-nightly.286 (as mentioned in #5036 in this comment) works, however this older version is much slower, etc.

My currently best “solution” is to simply ignore the ‘EPERM’ errors, because they don’t abort the parcel build process 😉