-
Notifications
You must be signed in to change notification settings - Fork 943
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
Error when running emulator: "EPERM: operation not permitted, rename..." #1112
Comments
Couple things to try:
|
(and thank you for the very detailed report - it helps when all that information is included 😄) |
I'll try tomorrow, thank you! And yeah, the different drives thing came to mind, but I didn't try it, I thought it was a bit far-fetched ahah. |
Do you have any user restrictions on your machine? This seems to be a filesystem permissions issue, not directly an issue with the Firebase CLI. Is there a reason you might not have write permission to the |
@mbleigh no idea. I'm using the administrator user, and I'm even running the cmd window as admin, and I've even removed the "read-only" check from all the involved folders, if any. Since it's trying to rename 'firebase-tools.json.538670987' to 'firebase-tools.json', then I thought it might have created the firebase-tools.json.538670987' with a read-only attribute somehow. |
Alright, downgrading node to version 8 didn't fix it, (it actually broke my GitHub Desktop and I had to re-install it, so maybe I should file a bug report for that too, but I have work to do). Moving the folder to the drive C also failed. Edit: For now, as a work-around I'm just disabling firebase-tools when I run the local emulator, but that's not ideal, since I can't test the functions that use it now. |
Your You've definitely got me stumped. Without sitting down at your machine and debugging, it's gonna be hard to really describe. If you go into the installed code for Maybe, just maybe, blowing away the folder in which that file lives might help so that it can be recreated. Other than that, I feel like I might be just grasping at straws... |
@bkendall It wasn't on the same drive, but I tried moving it to the same drive (C) and it din't work either. |
Yes - deleting it. :) Try it with the global version. Are you normally running the emulator through a |
I'll try it now. Normally I run it with The versions seem to be the same both globally and locally:
|
You've got me baffled. You may have better luck on Stack Overflow asking this question as that usually has more traffic going by it. |
Alright, I tried reinstalling the global one, and the problem persists. Ah, I was banned from asking new questions on SO a while ago, it's a pain making a new account. I guess I'll just use the workaround until it's fixed. Maybe completely reinstalling everything from scratch on a new system might fix it, since apparently I'm the only one having this problem, so I might try that some day. |
Okay. Sorry I can't be of more help. If you discover the issue, let us know! |
@Metsuryu are you by any chance running this from a non-admin cmd? (maybe inside webstorm or something like this) |
@kaminskypavel I'm running the cmd from an admin account, and even clicking "Run as Admin" form the context menu. |
@Metsuryu happened to me as well, but running from an elevated cmd did the trick |
@kaminskypavel doesn't seem to change anything for me. |
I suffered from this problem too, and it seems to be common across node/npm. For me, removing If that doesn't help, these threads might be useful:
TL;DR:Run Failing that: Close all editors and node processes and try again. Failing that: Disable your anti-virus and try again. |
@CamWass Unfortunately, I had already tried that multiple times, even with Anyway, I'll take a look at those links, thanks. |
Same challenge here (this is the second time it's happened). Tried all those solutions the first time, and nothing worked save creating a 'clean' firebase project and then moving all the sources across, reinstalling all the extra packages, etc. Eventually got it back to where I was. Now it's happened again, and I'm going straight to that. |
And, I thought I'd just try one more thing... I deleted For the record, |
@dsl101 Where is this |
Sorry—my bad.
|
Had the same problem. What worked for me was to close Visual Studio Code, and then run |
For me just opening the offending file ( |
For anyone bumping into this page Googling the error - I had the same problem when closing down Firebase emulator on a windows 10 machine. In my case it is a locking problem caused by either vscode, npm run dev (functions/react app), I can avoid the issue by closing down the emulator last (after closing vscode, npm dev in home, and npm run dev in functions) - I am using three separate terminal windows to run these processes. |
Running into the same issue here as @Tommertom after closing down the auth emulator attempting to use the None of the suggested fixes worked for me - clearing npm cache, running terminal as admin, closing it last, etc. |
...and found it immediately after posting (+ the hours of searching for the cause before posting) -- always the way! So I'm running Expo/React Native and the Expo process is watching the entire project directory, but even when you close that process first it still seems to keep the lock on all the files for a while (or maybe it's something to do with the Expo watch running over the Firebase data files at the start when the emulators are started and the initial data is brought in via the Either way, fixed by just exporting to/importing from a directory at least up one level from the main project. |
Sometimes, when I run
firebase functions:shell
orfirebase serve --only functions
to start the local emulator, this is the error I get (without --debug):Sometimes it doesn't happen, I wasn't able to figure out why it only happens sometimes. Disabling the antivirus doesn't seem to work consistently.
[REQUIRED] Environment info
firebase-tools: 6.3.0
I'm using 6.3.0 both globally, and in the functions' package.json. The problem started happening only after I started using it in the cloud functions.
Platform: Windows
[REQUIRED] Steps to reproduce
After installing firebase-tools, and importing it in the cloud functions, like this:
import * as firebase_tools from "firebase-tools";
executing a command to start the local emulator (
firebase functions:shell
orfirebase serve --only functions
) will sometimes not work, showing the above error.Removing
import * as firebase_tools from "firebase-tools";
solves the problem, so I am fairly sure firebase-tools is causing it.[REQUIRED] Expected behavior
The local emulator should start properly every time.
[REQUIRED] Actual behavior
The local emulator starts only sometimes, and other times it throws an error.
Here is the output with --debug:
And I can't use the functions when it errors like this, so I have to retry until it works.
The text was updated successfully, but these errors were encountered: