FIrebase deploy error: Cannot find module 'firebase-admin'
So the issue is that package.json inside Functions folder is different from package.json in your project directory. yes, you have 2 of this file!
So if you want to deploy, (deploy Functions), run npm install express or install other dependencies inside Function folder and you will be able to deploy with no error.
Update file package.json in folder functions and look at dependencies remove sign ~ from firebase-admin and ^ from firebase-functions it should be like:
"dependencies": {
"firebase-admin": "5.4.0",
"firebase-functions": "0.7.0"
}
in command line type
npm install
and then try to deploy again.
They have an active service disruption. Follow this for a workaround: https://status.firebase.google.com/incident/Functions/17024
Run the following commands inside the functions repository:
npm install --save-exact [email protected] npm install --save-exact [email protected]
Then try deploying functions again:
firebase deploy --only functions
If npm doesn't work, you can try yarn which worked for us:
yarn add [email protected] --exact yarn add [email protected] --exact