Error: Cannot find module 'firebase-admin'

1,741 views
Skip to first unread message

Bill Tricarico

unread,
Oct 19, 2017, 3:01:25 AM10/19/17
to Firebase Google Group
Hello,

So I have new Firebase/Firestore project for Cloud Functions, and I have my index.js setting up for firebase-functions and firebase-admin like so:

const functions = require("firebase-functions");
const admin = require("firebase-admin").initializeApp(functions.config().firebase);

My package.json looks like this:

{
"name": "functions",
"description": "Cloud Functions for Firebase",
"dependencies": {
"firebase-admin": "~5.4.2",
"firebase-functions": "^0.7.1"
},
"private": true
}


I have done this before in other projects with no problems. Now when I try to "firebase deploy" the project, 
I get this error over and over:

Deploy Error: Function load error: Code in file index.js can't be loaded.
Did you list all required modules in the package.json dependencies?
Detailed stack trace: Error: Cannot find module 'firebase-admin'

Laurent Pellegrino

unread,
Oct 19, 2017, 7:46:41 AM10/19/17
to Firebase Google Group

Bill Tricarico

unread,
Oct 19, 2017, 12:08:10 PM10/19/17
to Firebase Google Group
Yes I see that it was not me.  It was the Google. :/

Robert Nelson

unread,
Oct 19, 2017, 1:45:47 PM10/19/17
to Firebase Google Group
I am having the same issue.

It seems to be on Google's end. Here's a work around they released: https://status.firebase.google.com/incident/Functions/17024

However, the workaround is not working for me. I might be missing something simple though. I'm guessing they'll have everything working again in the morning.

Good luck!

Manfredt Kavetu

unread,
Oct 19, 2017, 1:45:47 PM10/19/17
to Firebase Google Group
Nothing wrong with your code, it is an error on Firebase cloud functions, see this link for a fix:

https://status.firebase.google.com/incident/Functions/17024
Reply all
Reply to author
Forward
0 new messages