ESLint error while trying to deploy firebase functions

好久不见. 提交于 2019-12-03 11:32:33

The only way I can imagine that your project got into this state is if you refused to allow npm to install dependencies at the time of project creation. So when you asks you this:

? Do you want to install dependencies with npm now?

You may have answered 'No'. This would prevent the eslint package from being installed, and you would see that error.

Otherwise, you may have deleted the eslint installed package under node_modules somehow. You can run npm install from the functions folder to recreate everything needed under node_modules.

Had the same problem I reinstalled npm

npm install npm -g

then reinitiated the Firebase functions (you have to overwrite all files and make sure to install EsLine the debugging and install all dependencies ) yes press Y for any request

Firebase init functions

and everything worked just fine after deploying again

Firebase deploy

hey you just need to return something from then statement

let params = {...};
var firestore = admin.firestore();
var dbRef = firestore.collection('your-collection-name');

dbRef.add(params)
     .then((docRef) => {
       console.log("doc added with ID ", docRef.id);

       return null
     })
     .catch((err) => {
       console.error("Error in adding document ", err);
     });

I had a similar error appear. I found out that my directory that held the firebase project was named firebase/database. I removed the / and made the directory name firebase-database. Hopefully that helps someone.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!