title: TypeError: firebase.functions is not a function
body: <p>I know someone else has <a href="https://stackoverflow.com/questions/49480761/cloud-functions-with-firebase-firebase-functions-is-not-a-function">posted this question before</a>, but I believe mine has a right declaration and still doesn't work:</p>
  
  <p><strong>Running the sendEmail.js:</strong></p>
  
  <pre><code>node sendEmail.js
  </code></pre>
  
  <p><strong>Inside sendEmail.js:</strong></p>
  
  <pre><code>"use strict";
  // Initialize Function Caller App
  const firebase = require("firebase");
  // Required for side-effects
  require("firebase/functions");
  
  var config = {
    apiKey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    authDomain: "my-project-id.firebaseapp.com",
    databaseURL: "https://my-project-id.firebaseio.com",
    projectId: "my-project-id",
    storageBucket: "my-project-id.appspot.com",
    messagingSenderId: "xxxxxxxxxx"
  };
  firebase.initializeApp(config);
  
  var functions = firebase.functions(); // Error here: TypeError: firebase.functions is not a function
  </code></pre>
  
  <p>I got the above sample from the <a href="https://firebase.google.com/docs/functions/callable" rel="nofollow noreferrer">Firebase Documentation</a>. It works for my other project but not the current one. I've also run the following in my <code>sendEmail.js</code> folder:</p>
  
  <pre><code>npm install firebase@5.10.1 --save
  </code></pre>
  
  <p>In my Firebase project root folder, my <code>package.json</code> file has the <code>firebase-functions</code> dependency too:</p>
  
  <pre><code>"dependencies": {
      "firebase": "^5.10.0",
      "firebase-admin": "^7.3.0",
      "firebase-functions": "^2.3.0",
      "nodemailer": "^6.1.0"
    },
  </code></pre>
  
  <p>But FYI, my <code>sendEmail.js</code> is in the following folder:</p>
  
  <pre><code>project-root\testing\sendEmail.js
  project-root\testing\node_modules\@firebase
  project-root\testing\node_modules\@firebase\functions
  </code></pre>
  
  <p>And I still get this error:</p>
  
  <pre><code>var functions = firebase.functions();
                           ^
  TypeError: firebase.functions is not a function
      at Object.&lt;anonymous&gt; (d:\project-root\testing\sendEmail.js:17:26)
      at Module._compile (module.js:652:30)
      at Object.Module._extensions..js (module.js:663:10)
      at Module.load (module.js:565:32)
      at tryModuleLoad (module.js:505:12)
      at Function.Module._load (module.js:497:3)
      at Function.Module.runMain (module.js:693:10)
      at startup (bootstrap_node.js:191:16)
      at bootstrap_node.js:612:3
  </code></pre>
  
  <p>May I know what else do I need to check? Any help will be much appreciated, thank you!</p>