title: vue-cli v3 with node.js firebase functions, firebase hosting (Error: No npm package found in functions source directory)
body: <p>I'd like to use Vue.js for Frontend and Firebase Functions (Express.js) + Firestore on Backend.</p>
  
  <p>0-step: I created a new project on Google Firebase, I created a new Service Account with Owner's permissions (for use it with Admin SDK later)</p>
  
  <p>1st step: I installed vue-cli v3 and created project: </p>
  
  <pre><code>$ vue create my-project
  $ npm run serve //localhost:8080 OK
  </code></pre>
  
  <p>2nd step:</p>
  
  <pre><code>$npm install firebase firebase-admin firebase-functions --save
  </code></pre>
  
  <p>Folder structure:</p>
  
  <pre><code>my-project
    .firebaserc //created (edited) manually
    babel.config.js
    firebase.json //created (edited) manually
    package.json
    dist
    node_modules
    public
    src
      assets
      components
      firebase
        functions
          index.js //here are my functions
        service-accounts
      views
  </code></pre>
  
  <p>firebase.json: (copied from other project and edited manually)</p>
  
  <pre><code>{
    "functions:": {
      "source": "src/firebase/functions"
    },
    "hosting": {
      "public": "public",
      "ignore": [...]
    }
  }
  </code></pre>
  
  <p><strong>src/functions/index.js:</strong></p>
  
  <pre><code>import functions from 'firebase-functions';
  import admin from 'firebase-admin';
  
  const serviceAccount = require('../service-accounts/owner-key.json');
  admin.initializeApp({
    credentials: admin.credencial.cert(serviceAccount),
    databaseURL: 'my-project.firebaseio.com'
  })
  const db = admin.firestore();
  ...
  </code></pre>
  
  <p>In the <strong>package.json</strong> file I have added extra scripts:</p>
  
  <pre><code>"deploy": "vue-cli-service build &amp;&amp; firebase deploy --only hosting,functions"
  </code></pre>
  
  <p>but when I run "<strong>npm run deploy</strong>" command I receive an error:</p>
  
  <p><strong>No npm package found in functions source directory. Please run 'npm init' inside src/firebase/functions</strong></p>
  
  <p>My question is next: why does it need to install firebase functions packages only inside the functions source directory and can I use firebase-functions which I installed in the top-level node_modules folder?</p>