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

Getting error in rename of files from .~BJCgJqW_l.json to BJCgJqW_l.json #157

Closed
balasivagnanam opened this issue Feb 3, 2017 · 3 comments

Comments

@balasivagnanam
Copy link

I am using lowdb version 0.10.3 and I am using node version 7.2.1

Everything was working well and suddenly I am getting this error.

node_modules\lowdb\src\disk.js:15
if (err) throw err
^
Error: EPERM: operation not permitted, rename 'C:\Codes\momtest0.5-cdn\portal\compresults.~BJCgJqW_l.json' -> 'C:\Codes\momtest0.5-cdn\portal\compresults\BJCgJqW_l.json'

@typicode
Copy link
Owner

typicode commented Feb 11, 2017

Hi @balasivagnanam,

I don't really know. That's strange because the only thing it does is renaming the file.
Did you check the permissions?

You can try to update lowdb but it may not solve the error.

@vladimiry
Copy link

That's strange because the only thing it does is renaming the file.

On Windows EPERM error usually occurs when the file is locked, see details here isaacs/node-graceful-fs#119. The workaround is applying retry scenario for renaming action.

@typicode
Copy link
Owner

typicode commented Dec 8, 2023

Would using graceful-fs in lowdb fix this error?

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

No branches or pull requests

3 participants