Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fs.move folder report EPERM error #684

Closed
fpsqdb opened this issue May 14, 2019 · 10 comments · Fixed by electron/get#95
Closed

fs.move folder report EPERM error #684

fpsqdb opened this issue May 14, 2019 · 10 comments · Fixed by electron/get#95

Comments

@fpsqdb
Copy link

fpsqdb commented May 14, 2019

  • Operating System: Windows 10 1809 17763.475
  • Node.js version: 7.9.0 (within electron 1.7.9)
  • fs-extra version: 8.0.0

fs.move folder will cause EPERM error, it works fine if downgrade to 7.0.1.

@manidlou
Copy link
Collaborator

We added checking paths in v8.0.1 that stats src and dest. Seems like the running process doesn't have permissions to stat the folder! Windows is known to throw EPERM error in different situations!

I am thinking maybe we should remove path checking in move! My primary goal was to be consistent with copy as well as avoiding possible future bugs. But if we believe it is not that needed for move, I am fine removing it! We can take care of the 🐛s once they show up!

@manidlou
Copy link
Collaborator

Also could be because we disabled graceful-fs (#664) and switched to native fs as graceful-fs needs to be updated. Basically, graceful-fs has some improvements over native fs like handling EPERM error on windows when trying to rename a file.

@RyanZim
Copy link
Collaborator

RyanZim commented May 21, 2019

Has anyone else been able to reproduce this? @fpsqdb can you write a failing test case?

@malept
Copy link

malept commented May 21, 2019

FWIW, I can reproduce this in the Electron Packager testsuite, but unfortunately since I don't personally own a Windows machine, it would be rather difficult for me to write a minimal testcase.

@manidlou
Copy link
Collaborator

manidlou commented May 22, 2019

Another thing is I am wondering if it happens outside of electron as well! Has anyone been also experiencing this in environments other than electron?

@fpsqdb
Copy link
Author

fpsqdb commented May 22, 2019

electron-quick-start.zip

npm install

npm run start

If there are no errors, delete the dest/test folder and try again.

20190522114142

@malept
Copy link

malept commented May 22, 2019

The Electron Packager tests run in a Node environment, not an Electron one.

@manidlou
Copy link
Collaborator

Looking at the provided travis log, EPERM error comes from rename and the only thing that is changed in the internal rename function of move from fs-extra 7.0.1 to 8.0.1 is that we use native fs instead of graceful-fs temporarily (#664). My gut tells me once we switch back to graceful-fs this will be resolved. Basically, this is one of the reasons (advantages) that we use graceful-fs as a dependency so that we don't need to do extra work for cases like this here in our codebase!

@malept
Copy link

malept commented Jun 27, 2019

FYI, graceful-fs 4.2.0 has been released with the fs.stat() fix.

@RyanZim
Copy link
Collaborator

RyanZim commented Jun 27, 2019

On it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants