首页 > 解决方案 > How to disable Firebase Storage emulator?

问题描述

When I start the emulators, the Storage emulator starts and is available at localhost:9199.
Then I access storage with the admin SDK in node.js with:

serviceAccountKey = require('./serviceAccountKey.json');
const config = {
  credential: admin.credential.cert(serviceAccountKey),
};
const adminApp = admin.initializeApp(config);
const storage = adminApp.storage();

Now storage points to the emulator, not the real service as before this emulator has been implemented.
How can I get access to the real service?
I have tried setting projectId and the env variable as described here, but it does not work.

标签: firebasefirebase-storagefirebase-cli

解决方案


OK, so the way is simply to start all services but storage from the command line, and not from firebase.json, this way:

firebase emulators:start --only hosting,functions,firestore,auth,ui

推荐阅读