Sometimes, when I run firebase functions:shell or firebase serve --only functions to start the local emulator, this is the error I get (without --debug):
Error: EPERM: operation not permitted, rename 'C:\Users\Metsuryu\.config\configs
tore\firebase-tools.json.538670987' -> 'C:\Users\Metsuryu\.config\configstore\fi
rebase-tools.json'
at Object.renameSync (fs.js:594:3)
at Function.writeFileSync [as sync] (D:\Users\2Punx2Furious\Desktop\Dev\Proj
ects\Work\new-lantea\functions\node_modules\firebase-tools\node_modules\write-fi
le-atomic\index.js:124:8)
at Configstore.set (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:62:2
1)
at new Configstore (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:27:1
1)
at Object.<anonymous> (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-
lantea\functions\node_modules\firebase-tools\lib\configstore.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)]
error: code=500, status=INTERNAL, message=Function worker crashed with exit cod
e: 1
undefinedD:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lantea\functions\n
ode_modules\firebase-tools\node_modules\configstore\index.js:69
throw err;
^
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.
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
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 or firebase 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.
The local emulator should start properly every time.
The local emulator starts only sometimes, and other times it throws an error.
Here is the output with --debug:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lantea>firebase functions:s
hell --debug
[2019-01-18T08:07:55.767Z] -----------------------------------------------------
-----------------
[2019-01-18T08:07:55.771Z] Command: C:\Program Files\nodejs\node.exe C:\Us
ers\Metsuryu\AppData\Roaming\npm\node_modules\firebase-tools\lib\bin\firebase.js
functions:shell --debug
[2019-01-18T08:07:55.772Z] CLI Version: 6.3.0
[2019-01-18T08:07:55.772Z] Platform: win32
[2019-01-18T08:07:55.772Z] Node Version: v10.15.0
[2019-01-18T08:07:55.773Z] Time: Fri Jan 18 2019 09:07:55 GMT+0100 (GMT
+01:00)
[2019-01-18T08:07:55.774Z] -----------------------------------------------------
-----------------
[2019-01-18T08:07:55.783Z] > command requires scopes: ["email","openid","https:/
/www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis
.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2019-01-18T08:07:55.786Z] > authorizing via signed-in user
[2019-01-18T08:07:55.786Z] [iam] checking project new-lantea for permissions ["f
irebase.projects.get"]
[2019-01-18T08:07:55.788Z] >>> HTTP REQUEST POST https://cloudresourcemanager.go
ogleapis.com/v1/projects/new-lantea:testIamPermissions
permissions=[firebase.projects.get]
[2019-01-18T08:07:56.710Z] <<< HTTP RESPONSE 200 content-type=application/json;
charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Fri, 18 Jan
2019 08:07:53 GMT, server=ESF, cache-control=private, x-xss-protection=1; mode=b
lock, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic="
:443"; ma=2592000; v="44,43,39,35", accept-ranges=none, transfer-encoding=chunke
d
i functions: Preparing to emulate functions.
[2019-01-18T08:07:57.342Z] Fetching environment
[2019-01-18T08:07:57.344Z] >>> HTTP REQUEST GET https://cloudresourcemanager.goo
gleapis.com/v1/projects/new-lantea
[2019-01-18T08:07:58.206Z] <<< HTTP RESPONSE 200 content-type=application/json;
charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Fri, 18 Jan
2019 08:07:55 GMT, server=ESF, cache-control=private, x-xss-protection=1; mode=b
lock, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic="
:443"; ma=2592000; v="44,43,39,35", accept-ranges=none, transfer-encoding=chunke
d
[2019-01-18T08:07:58.210Z] >>> HTTP REQUEST GET https://mobilesdk-pa.googleapis.
com/v1/projects/260007026360:getServerAppConfig
[2019-01-18T08:07:58.522Z] <<< HTTP RESPONSE 200 content-type=application/json;
charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Fri, 18 Jan
2019 08:07:55 GMT, server=ESF, cache-control=private, x-xss-protection=1; mode=b
lock, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=quic="
:443"; ma=2592000; v="44,43,39,35", accept-ranges=none, transfer-encoding=chunke
d
[2019-01-18T08:07:58.525Z] Starting @google-cloud/functions-emulator
Warning: You're using Node.js v10.15.0 but Google Cloud Functions only supports
v6.11.5.
[2019-01-18T08:08:01.162Z] Parsing function triggers
[2019-01-18T08:08:02.968Z] Deploying functions locally
[2019-01-18T08:08:02.969Z] Deploying functions locally
[2019-01-18T08:08:02.969Z] Deploying functions locally
[2019-01-18T08:08:02.976Z] Deploying functions locally
info: analyticsAPI initialized
info: analyticsAPI initialized
info: analyticsAPI initialized
info: analyticsAPI initialized
info: analyticsAPI initialized
info: analyticsAPI initialized
info: analyticsAPI initialized
info: analyticsAPI initialized
info: analyticsAPI initialized
info: analyticsAPI initialized
info: analyticsAPI initialized
info: analyticsAPI initialized
info: analyticsAPI initialized
info: analyticsAPI initialized
info: analyticsAPI initialized
info: analyticsAPI initialized
info: analyticsAPI initialized
info: analyticsAPI initialized
info: analyticsAPI initialized
info: analyticsAPI initialized
info: analyticsAPI initialized
info: analyticsAPI initialized
info: analyticsAPI initialized
error: D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lantea\functions\nod
e_modules\firebase-tools\node_modules\configstore\index.js:69
throw err;
^
Error: EPERM: operation not permitted, rename 'C:\Users\Metsuryu\.config\configs
tore\firebase-tools.json.3792409641' -> 'C:\Users\Metsuryu\.config\configstore\f
irebase-tools.json'
at Object.renameSync (fs.js:594:3)
at Function.writeFileSync [as sync] (D:\Users\2Punx2Furious\Desktop\Dev\Proj
ects\Work\new-lantea\functions\node_modules\firebase-tools\node_modules\write-fi
le-atomic\index.js:124:8)
at Configstore.set (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:62:2
1)
at new Configstore (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:27:1
1)
at Object.<anonymous> (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-
lantea\functions\node_modules\firebase-tools\lib\configstore.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
error: D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lantea\functions\nod
e_modules\firebase-tools\node_modules\configstore\index.js:69
throw err;
^
Error: EPERM: operation not permitted, rename 'C:\Users\Metsuryu\.config\configs
tore\firebase-tools.json.4192902253' -> 'C:\Users\Metsuryu\.config\configstore\f
irebase-tools.json'
at Object.renameSync (fs.js:594:3)
at Function.writeFileSync [as sync] (D:\Users\2Punx2Furious\Desktop\Dev\Proj
ects\Work\new-lantea\functions\node_modules\firebase-tools\node_modules\write-fi
le-atomic\index.js:124:8)
at Configstore.set (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:62:2
1)
at new Configstore (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:27:1
1)
at Object.<anonymous> (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-
lantea\functions\node_modules\firebase-tools\lib\configstore.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
error: D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lantea\functions\nod
e_modules\firebase-tools\node_modules\configstore\index.js:69
throw err;
^
Error: EPERM: operation not permitted, rename 'C:\Users\Metsuryu\.config\configs
tore\firebase-tools.json.3609321230' -> 'C:\Users\Metsuryu\.config\configstore\f
irebase-tools.json'
at Object.renameSync (fs.js:594:3)
at Function.writeFileSync [as sync] (D:\Users\2Punx2Furious\Desktop\Dev\Proj
ects\Work\new-lantea\functions\node_modules\firebase-tools\node_modules\write-fi
le-atomic\index.js:124:8)
at Configstore.set (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:62:2
1)
at new Configstore (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:27:1
1)
at Object.<anonymous> (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-
lantea\functions\node_modules\firebase-tools\lib\configstore.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
error: D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lantea\functions\nod
e_modules\firebase-tools\node_modules\configstore\index.js:69
throw err;
^
Error: EPERM: operation not permitted, rename 'C:\Users\Metsuryu\.config\configs
tore\firebase-tools.json.132014655' -> 'C:\Users\Metsuryu\.config\configstore\fi
rebase-tools.json'
at Object.renameSync (fs.js:594:3)
at Function.writeFileSync [as sync] (D:\Users\2Punx2Furious\Desktop\Dev\Proj
ects\Work\new-lantea\functions\node_modules\firebase-tools\node_modules\write-fi
le-atomic\index.js:124:8)
at Configstore.set (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:62:2
1)
at new Configstore (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:27:1
1)
at Object.<anonymous> (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-
lantea\functions\node_modules\firebase-tools\lib\configstore.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
error: D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lantea\functions\nod
e_modules\firebase-tools\node_modules\configstore\index.js:69
throw err;
^
Error: EPERM: operation not permitted, rename 'C:\Users\Metsuryu\.config\configs
tore\firebase-tools.json.1807046972' -> 'C:\Users\Metsuryu\.config\configstore\f
irebase-tools.json'
at Object.renameSync (fs.js:594:3)
at Function.writeFileSync [as sync] (D:\Users\2Punx2Furious\Desktop\Dev\Proj
ects\Work\new-lantea\functions\node_modules\firebase-tools\node_modules\write-fi
le-atomic\index.js:124:8)
at Configstore.set (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:62:2
1)
at new Configstore (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:27:1
1)
at Object.<anonymous> (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-
lantea\functions\node_modules\firebase-tools\lib\configstore.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
error: D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lantea\functions\nod
e_modules\firebase-tools\node_modules\configstore\index.js:69
throw err;
^
Error: EPERM: operation not permitted, rename 'C:\Users\Metsuryu\.config\configs
tore\firebase-tools.json.2830257114' -> 'C:\Users\Metsuryu\.config\configstore\f
irebase-tools.json'
at Object.renameSync (fs.js:594:3)
at Function.writeFileSync [as sync] (D:\Users\2Punx2Furious\Desktop\Dev\Proj
ects\Work\new-lantea\functions\node_modules\firebase-tools\node_modules\write-fi
le-atomic\index.js:124:8)
at Configstore.set (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:62:2
1)
at new Configstore (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:27:1
1)
at Object.<anonymous> (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-
lantea\functions\node_modules\firebase-tools\lib\configstore.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
error: Function worker crashed with exit code: 1
error: Function worker crashed with exit code: 1
error: Function worker crashed with exit code: 1
error: Function worker crashed with exit code: 1
error: Function worker crashed with exit code: 1
error: Function worker crashed with exit code: 1
info: analyticsAPI initialized
info: analyticsAPI initialized
info: analyticsAPI initialized
+ functions: updateUserData
+ functions: issueArticleAward
+ functions: changeTransactionStatus
+ functions: daily_job
+ functions: tenmin_job
+ functions: monthly_job
+ functions: addToArticleComments
+ functions: editComment
+ functions: removeComment
+ functions: voteComment
+ functions: deleteArticle
+ functions: likeOrFavorite
+ functions: followUser
+ functions: functionsTest
+ functions: updateFollowerImage
+ functions: addDraft
+ functions: addArticleToSearchIndex
+ functions: addArticle
+ functions: hideEveryArticleByUser
+ functions: savePushSubscription
+ functions: sendCustomEmailsToUsersList
info: analyticsAPI initialized
info: analyticsAPI initialized
info: analyticsAPI initialized
info: analyticsAPI initialized
info: analyticsAPI initialized
info: analyticsAPI initialized
info: analyticsAPI initialized
error: code=500, status=INTERNAL, message=Function worker crashed with exit cod
e: 1
undefinedD:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lantea\functions\n
ode_modules\firebase-tools\node_modules\configstore\index.js:69
throw err;
^
Error: EPERM: operation not permitted, rename 'C:\Users\Metsuryu\.config\configs
tore\firebase-tools.json.1807046972' -> 'C:\Users\Metsuryu\.config\configstore\f
irebase-tools.json'
at Object.renameSync (fs.js:594:3)
at Function.writeFileSync [as sync] (D:\Users\2Punx2Furious\Desktop\Dev\Proj
ects\Work\new-lantea\functions\node_modules\firebase-tools\node_modules\write-fi
le-atomic\index.js:124:8)
at Configstore.set (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:62:2
1)
at new Configstore (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:27:1
1)
at Object.<anonymous> (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-
lantea\functions\node_modules\firebase-tools\lib\configstore.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3), errors=[Fun
ction worker crashed with exit code: 1
undefinedD:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lantea\functions\n
ode_modules\firebase-tools\node_modules\configstore\index.js:69
throw err;
^
Error: EPERM: operation not permitted, rename 'C:\Users\Metsuryu\.config\configs
tore\firebase-tools.json.1807046972' -> 'C:\Users\Metsuryu\.config\configstore\f
irebase-tools.json'
at Object.renameSync (fs.js:594:3)
at Function.writeFileSync [as sync] (D:\Users\2Punx2Furious\Desktop\Dev\Proj
ects\Work\new-lantea\functions\node_modules\firebase-tools\node_modules\write-fi
le-atomic\index.js:124:8)
at Configstore.set (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:62:2
1)
at new Configstore (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:27:1
1)
at Object.<anonymous> (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-
lantea\functions\node_modules\firebase-tools\lib\configstore.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)]
error: code=500, status=INTERNAL, message=Function worker crashed with exit cod
e: 1
undefinedD:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lantea\functions\n
ode_modules\firebase-tools\node_modules\configstore\index.js:69
throw err;
^
Error: EPERM: operation not permitted, rename 'C:\Users\Metsuryu\.config\configs
tore\firebase-tools.json.3792409641' -> 'C:\Users\Metsuryu\.config\configstore\f
irebase-tools.json'
at Object.renameSync (fs.js:594:3)
at Function.writeFileSync [as sync] (D:\Users\2Punx2Furious\Desktop\Dev\Proj
ects\Work\new-lantea\functions\node_modules\firebase-tools\node_modules\write-fi
le-atomic\index.js:124:8)
at Configstore.set (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:62:2
1)
at new Configstore (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:27:1
1)
at Object.<anonymous> (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-
lantea\functions\node_modules\firebase-tools\lib\configstore.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3), errors=[Fun
ction worker crashed with exit code: 1
undefinedD:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lantea\functions\n
ode_modules\firebase-tools\node_modules\configstore\index.js:69
throw err;
^
Error: EPERM: operation not permitted, rename 'C:\Users\Metsuryu\.config\configs
tore\firebase-tools.json.3792409641' -> 'C:\Users\Metsuryu\.config\configstore\f
irebase-tools.json'
at Object.renameSync (fs.js:594:3)
at Function.writeFileSync [as sync] (D:\Users\2Punx2Furious\Desktop\Dev\Proj
ects\Work\new-lantea\functions\node_modules\firebase-tools\node_modules\write-fi
le-atomic\index.js:124:8)
at Configstore.set (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:62:2
1)
at new Configstore (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:27:1
1)
at Object.<anonymous> (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-
lantea\functions\node_modules\firebase-tools\lib\configstore.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)]
error: code=500, status=INTERNAL, message=Function worker crashed with exit cod
e: 1
undefinedD:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lantea\functions\n
ode_modules\firebase-tools\node_modules\configstore\index.js:69
throw err;
^
Error: EPERM: operation not permitted, rename 'C:\Users\Metsuryu\.config\configs
tore\firebase-tools.json.2830257114' -> 'C:\Users\Metsuryu\.config\configstore\f
irebase-tools.json'
at Object.renameSync (fs.js:594:3)
at Function.writeFileSync [as sync] (D:\Users\2Punx2Furious\Desktop\Dev\Proj
ects\Work\new-lantea\functions\node_modules\firebase-tools\node_modules\write-fi
le-atomic\index.js:124:8)
at Configstore.set (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:62:2
1)
at new Configstore (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:27:1
1)
at Object.<anonymous> (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-
lantea\functions\node_modules\firebase-tools\lib\configstore.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3), errors=[Fun
ction worker crashed with exit code: 1
undefinedD:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lantea\functions\n
ode_modules\firebase-tools\node_modules\configstore\index.js:69
throw err;
^
Error: EPERM: operation not permitted, rename 'C:\Users\Metsuryu\.config\configs
tore\firebase-tools.json.2830257114' -> 'C:\Users\Metsuryu\.config\configstore\f
irebase-tools.json'
at Object.renameSync (fs.js:594:3)
at Function.writeFileSync [as sync] (D:\Users\2Punx2Furious\Desktop\Dev\Proj
ects\Work\new-lantea\functions\node_modules\firebase-tools\node_modules\write-fi
le-atomic\index.js:124:8)
at Configstore.set (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:62:2
1)
at new Configstore (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:27:1
1)
at Object.<anonymous> (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-
lantea\functions\node_modules\firebase-tools\lib\configstore.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)]
error: code=500, status=INTERNAL, message=Function worker crashed with exit cod
e: 1
undefinedD:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lantea\functions\n
ode_modules\firebase-tools\node_modules\configstore\index.js:69
throw err;
^
Error: EPERM: operation not permitted, rename 'C:\Users\Metsuryu\.config\configs
tore\firebase-tools.json.3609321230' -> 'C:\Users\Metsuryu\.config\configstore\f
irebase-tools.json'
at Object.renameSync (fs.js:594:3)
at Function.writeFileSync [as sync] (D:\Users\2Punx2Furious\Desktop\Dev\Proj
ects\Work\new-lantea\functions\node_modules\firebase-tools\node_modules\write-fi
le-atomic\index.js:124:8)
at Configstore.set (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:62:2
1)
at new Configstore (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:27:1
1)
at Object.<anonymous> (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-
lantea\functions\node_modules\firebase-tools\lib\configstore.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3), errors=[Fun
ction worker crashed with exit code: 1
undefinedD:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lantea\functions\n
ode_modules\firebase-tools\node_modules\configstore\index.js:69
throw err;
^
Error: EPERM: operation not permitted, rename 'C:\Users\Metsuryu\.config\configs
tore\firebase-tools.json.3609321230' -> 'C:\Users\Metsuryu\.config\configstore\f
irebase-tools.json'
at Object.renameSync (fs.js:594:3)
at Function.writeFileSync [as sync] (D:\Users\2Punx2Furious\Desktop\Dev\Proj
ects\Work\new-lantea\functions\node_modules\firebase-tools\node_modules\write-fi
le-atomic\index.js:124:8)
at Configstore.set (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:62:2
1)
at new Configstore (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:27:1
1)
at Object.<anonymous> (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-
lantea\functions\node_modules\firebase-tools\lib\configstore.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)]
error: code=500, status=INTERNAL, message=Function worker crashed with exit cod
e: 1
undefinedD:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lantea\functions\n
ode_modules\firebase-tools\node_modules\configstore\index.js:69
throw err;
^
Error: EPERM: operation not permitted, rename 'C:\Users\Metsuryu\.config\configs
tore\firebase-tools.json.4192902253' -> 'C:\Users\Metsuryu\.config\configstore\f
irebase-tools.json'
at Object.renameSync (fs.js:594:3)
at Function.writeFileSync [as sync] (D:\Users\2Punx2Furious\Desktop\Dev\Proj
ects\Work\new-lantea\functions\node_modules\firebase-tools\node_modules\write-fi
le-atomic\index.js:124:8)
at Configstore.set (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:62:2
1)
at new Configstore (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:27:1
1)
at Object.<anonymous> (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-
lantea\functions\node_modules\firebase-tools\lib\configstore.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3), errors=[Fun
ction worker crashed with exit code: 1
undefinedD:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lantea\functions\n
ode_modules\firebase-tools\node_modules\configstore\index.js:69
throw err;
^
Error: EPERM: operation not permitted, rename 'C:\Users\Metsuryu\.config\configs
tore\firebase-tools.json.4192902253' -> 'C:\Users\Metsuryu\.config\configstore\f
irebase-tools.json'
at Object.renameSync (fs.js:594:3)
at Function.writeFileSync [as sync] (D:\Users\2Punx2Furious\Desktop\Dev\Proj
ects\Work\new-lantea\functions\node_modules\firebase-tools\node_modules\write-fi
le-atomic\index.js:124:8)
at Configstore.set (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:62:2
1)
at new Configstore (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:27:1
1)
at Object.<anonymous> (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-
lantea\functions\node_modules\firebase-tools\lib\configstore.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)]
error: code=500, status=INTERNAL, message=Function worker crashed with exit cod
e: 1
undefinedD:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lantea\functions\n
ode_modules\firebase-tools\node_modules\configstore\index.js:69
throw err;
^
Error: EPERM: operation not permitted, rename 'C:\Users\Metsuryu\.config\configs
tore\firebase-tools.json.132014655' -> 'C:\Users\Metsuryu\.config\configstore\fi
rebase-tools.json'
at Object.renameSync (fs.js:594:3)
at Function.writeFileSync [as sync] (D:\Users\2Punx2Furious\Desktop\Dev\Proj
ects\Work\new-lantea\functions\node_modules\firebase-tools\node_modules\write-fi
le-atomic\index.js:124:8)
at Configstore.set (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:62:2
1)
at new Configstore (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:27:1
1)
at Object.<anonymous> (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-
lantea\functions\node_modules\firebase-tools\lib\configstore.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3), errors=[Fun
ction worker crashed with exit code: 1
undefinedD:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lantea\functions\n
ode_modules\firebase-tools\node_modules\configstore\index.js:69
throw err;
^
Error: EPERM: operation not permitted, rename 'C:\Users\Metsuryu\.config\configs
tore\firebase-tools.json.132014655' -> 'C:\Users\Metsuryu\.config\configstore\fi
rebase-tools.json'
at Object.renameSync (fs.js:594:3)
at Function.writeFileSync [as sync] (D:\Users\2Punx2Furious\Desktop\Dev\Proj
ects\Work\new-lantea\functions\node_modules\firebase-tools\node_modules\write-fi
le-atomic\index.js:124:8)
at Configstore.set (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:62:2
1)
at new Configstore (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-lan
tea\functions\node_modules\firebase-tools\node_modules\configstore\index.js:27:1
1)
at Object.<anonymous> (D:\Users\2Punx2Furious\Desktop\Dev\Projects\Work\new-
lantea\functions\node_modules\firebase-tools\lib\configstore.js:4:18)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)]
+ functions: getLanteaIDFromForumID
+ functions: deleteAccount
+ functions: sendReport
+ functions: incrementArticleViews
+ functions: saveToDatabaseLogsCF
+ functions: setArticleVisibility
+ functions: setAsArticleInSpotlight
+ functions: updateArticleSearchIndex
+ functions: sendPaymentRequestEmail
+ functions: sendNotification
! functions: Error from emulator. [object Object]
[2019-01-18T08:11:13.732Z]
firebase >
And I can't use the functions when it errors like this, so I have to retry until it works.
Couple things to try:
node version to 8 and see if you still get the same issues.C and D in this case) can cause odd issues. If you copy your workspace to C and try the same (so that the code you're running and firebase-tools are coming from the same drive (C)), do you see the same problem?(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 C:\Users\Metsuryu\.config\configs
tore directory?
@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 node installation is on the same drive as your code?
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 firebase-tools you _might_ be able to squeeze out more information about why it's failing.
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.
What do you mean by "blowing away" the folder? Deleting it, and reinstalling it? I've tried that, didn't help. At least, for the local version, not for the global version, so maybe I could try that?
Yes - deleting it. :)
Try it with the global version. Are you normally running the emulator through a npm script? Double check the versions that you're using in both places as well?
I'll try it now.
Normally I run it with firebase functions:shell from the console.
The versions seem to be the same both globally and locally:
C:UsersMetsuryu>firebase --version
6.3.0
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 functions/node_modules in my project directory, then running npm i (this is basically just a reinstall of all modules) fixed the problem.
If that doesn't help, these threads might be useful:
Run npm cache clean
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 cache clean, and -force, but it didn't work.
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. firebase functions:shell has also started taking 3–4 minutes to (fail to) start.
And, I thought I'd just try one more thing... I deleted /node_modules from the /firebase folder, (_not_ the /functions subfolder), and suddenly it's started working again. I don't know if that's connected, and since there's no package.json file in the main /firebase folder, there was nothing to reinstall. In fact, I'm not sure how that folder got there in the first place. But might be worth checking you don't have one lurking in there.
For the record, firebase functions:shell is still taking much longer to start than it used to (with node.exe running at 100% during that startup time), but I strongly suspect that's a different issue.
@dsl101 Where is this /firebase folder you deleted? In the project's folder?
Sorry—my bad. /firebase referred to the root of the firebase project itself (just bad naming for my test project :). So, to be clear:
/some/project/ ← Root of Firebase project
/some/project/node_modules/ ← Don't know where this came from, deleting fixed my issue
/some/project/functions/ ← Firebase functions subdirectory
/some/project/functions/node_modules/ ← Can be removed and recreated with 'npm i'
Had the same problem. What worked for me was to close Visual Studio Code, and then run npm i firebase in a normal (non admin) powershell window. Then it installed without problems. Seems that both Visual Studio Code and Atom locks some files.
Had the same problem. What worked for me was to close Visual Studio Code, and then run
npm i firebasein a normal (non admin) powershell window. Then it installed without problems. Seems that both Visual Studio Code and Atom locks some files.
For me just opening the offending file (./functions/package.json in my case), making a small edit and saving it released the VSCode lock.