Warm tip: This article is reproduced from stackoverflow.com, please click
google-cloud-firestore google-cloud-functions node.js npm firebase-cli

Trouble initializing firestore functions in flultter

发布于 2020-04-07 10:24:03

I'm trying to add firestore functions to my flutter project. Unfortunately, I seem to be having a lot of issues. If I use npm v13.7.0, the latest version, and run the function "firebase init functions" from the root of my project, I get the error

Error: Server Error. certificate has expired

I've tried updating firebase tools logging in and out of firebase in the command line, but none of this helps.

If I use npm version 10.6, I get the message

Firebase initialization complete!

However, it doesn't look like anything has actually been done - no "functions" folder has been created, and I can't find a firestore.json file associated with the project. It also gives me several messages like 'File functions/.eslintrc.json already exists. Overwrite?, however I can't find any such file.

Has anyone else run into these issues/has an idea of what to do?

Questioner
gollyzoom
Viewed
78
gollyzoom 2020-02-01 02:57

My problem was that I had actually initialized a firebase project in the folder above the folder I was working in, and whenever I called firebase init functions the functions folder was getting created in this higher level folder. I deleted the firebase.json file in the upper level directory, switched back to my directory of interest, and called firebase init functions again (using npm version 10.6), and then it worked.