Error: EROFS: read-only file system, open 'metadata.json'. => I used Firebase Functions. I deployed their json file. I can't able to write that json #920
Unanswered
prshnandaniya
asked this question in
Q&A
Replies: 1 comment
-
You're attempting to write to a read-only file system. Firebase Cloud Functions have a read-only file system except for the Solution:Use const fs = require('fs');
const path = '/tmp/metadata.json';
fs.writeFileSync(path, yourData); Note that /tmp is temporary storage, so files should be deleted when no longer needed. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Error: EROFS: read-only file system, open 'metadata.json'
at Object.openSync (fs.js:498:3)
at Object.writeFileSync (fs.js:1524:35)
at /workspace/index.js:113:8
at Layer.handle [as handle_request] (/workspace/node_modules/express/lib/router/layer.js:95:5)
at next (/workspace/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/workspace/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/workspace/node_modules/express/lib/router/layer.js:95:5)
at /workspace/node_modules/express/lib/router/index.js:281:22
at Function.process_params (/workspace/node_modules/express/lib/router/index.js:335:12)
at next (/workspace/node_modules/express/lib/router/index.js:275:10) {
Beta Was this translation helpful? Give feedback.
All reactions