Skip to content Skip to sidebar Skip to footer

Detailed Stack Trace: Error: Cannot Find Module "users/myhuser/downloads/myfolder/my.json/"

I am trying to push firebase functions with node.js and terminal. When I push and check my logs in firebase I am seeing, Detailed stack trace: Error: Cannot find module '/Users/my

Solution 1:

You can't use absolute paths to scripts with require on Cloud Functions. You will need to use a relative path, and make sure the file is in the functions folder. The Firebase CLI will only deploy the files in the functions folder. So, if you copy my.Json to sit next to node.js, you should be able to require it like this:

var serviceAccount = require('./my.Json');

Post a Comment for "Detailed Stack Trace: Error: Cannot Find Module "users/myhuser/downloads/myfolder/my.json/""