I was learning firebase to integrate with my react web app. I was trying to write functions for GET and POST requests and running them on postman using endpoints i get in my terminal in vscode. Now my code works perfectly with firebase deploy but gives me errors with i try using firebase serve. also i cannot just use these commands simply , i have to run them using sudo and then enter my password and only then i'm able to run them. below is the error list
The Cloud Firestore emulator is not running, so calls to Firestore will affect production.
⚠ External network resource requested! - URL: "http://169.254.169.254/computeMetadata/v1/instance" - Be careful, this may be a production service.
⚠ External network resource requested! - URL: "http://metadata.google.internal./computeMetadata/v1/instance" - Be careful, this may be a production service.
Error: Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.
at GoogleAuth.getApplicationDefaultAsync (/home/nikunj/socialape-functions/functions/node_modules/google-auth-library/build/src/auth/googleauth.js:160:19) at processTicksAndRejections (internal/process/task_queues.js:97:5) at async GoogleAuth.getClient (/home/nikunj/socialape-functions/functions/node_modules/google-auth-library/build/src/auth/googleauth.js:502:17) at async GrpcClient._getCredentials (/home/nikunj/socialape-functions/functions/node_modules/google-gax/build/src/grpc.js:92:24) at async GrpcClient.createStub (/home/nikunj/socialape-functions/functions/node_modules/google-gax/build/src/grpc.js:213:23)
Caused by: Error
at WriteBatch.commit (/home/nikunj/socialape-functions/functions/node_modules/@google-cloud/firestore/build/src/write-batch.js:415:23) at DocumentReference.create (/home/nikunj/socialape-functions/functions/node_modules/@google-cloud/firestore/build/src/reference.js:283:14) at CollectionReference.add (/home/nikunj/socialape-functions/functions/node_modules/@google-cloud/firestore/build/src/reference.js:2011:28) at /home/nikunj/socialape-functions/functions/index.js:32:10 at /usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:559:20 at /usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:534:19 at Generator.next (<anonymous>) at /usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:8:71 at new Promise (<anonymous>) at __awaiter (/usr/local/lib/node_modules/firebase-tools/lib/emulator/functionsEmulatorRuntime.js:4:12)
i functions: Finished "createScream" in ~1s