ESLint error while trying to deploy firebase functions
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
.
Easy fix. Inside your package.json change
> "lint": "eslint ."
to
"lint": "eslint",
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
If you found -prefix "%REASOURCE_DIR%" run init type error while deploying firebase project, then you have to edit some code in firebase.json file. Here is an Example
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);
});