title: Firebase error Each then() should return a value
body: <p>The main purpose is to send a notification to each unser registrated under "Device/(device id)/Users", and to have the device id first I´m looking in "Notifications/notID" which is the "device id" that will be used</p>
  
  <p>I got follow errors when deploy my code</p>
  
  <pre><code>✖ 5 problems (1 error, 4 warnings)
     0 errors and 2 warnings potentially fixable with the `--fix` option.
  
     npm ERR! code ELIFECYCLE
     npm ERR! errno 1
     npm ERR! functions@ lint: `eslint .`
     npm ERR! Exit status 1
     npm ERR!
     npm ERR! Failed at the functions@ lint script.
     npm ERR! This is probably not a problem with npm. There is likely 
        additional logging output above.
  
     npm ERR! A complete log of this run can be found in:
     npm ERR!     C:\Users\luisr\AppData\Roaming\npm-cache\_logs\2020-05- 
       22T18_46_41_843Z-debug.log events.js:288
        throw er; // Unhandled 'error' event
         ^
  
  Error: spawn npm --prefix "C:\Users\luisr\Documents\Proyectos\HOSI\CloudFunctions\SendNotification\functions" run lint ENOENT
  at notFoundError (C:\Users\luisr\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:6:26)
  at verifyENOENT (C:\Users\luisr\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:40:16)
  at ChildProcess.cp.emit (C:\Users\luisr\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:27:25)
  at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
  Emitted 'error' event on ChildProcess instance at:
  at ChildProcess.cp.emit 
  (C:\Users\luisr\AppData\Roaming\npm\node_modules\firebase- 
   tools\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:30:37)
  at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12) {
  code: 'ENOENT',
  errno: 'ENOENT',
  syscall: 'spawn npm --prefix 
  </code></pre>
  
  <p>"C:\Users\luisr\Documents\Proyectos\HOSI\CloudFunctions\SendNotification\functions" run lint',
    path: 'npm --prefix "C:\Users\luisr\Documents\Proyectos\HOSI\CloudFunctions\SendNotification\functions" run lint',
    spawnargs: []
  ]
      Error: functions predeploy error: Command terminated with non-zero exit code1</p>
  
  <p>I think that I´m not using promises like try/catch</p>
  
  <p>this my index.js file</p>
  
  <pre><code>    const functions = require('firebase-functions');
      const admin = require('firebase-admin');  // this is the Admin SDK, not firebase-functions
  
      admin.initializeApp(functions.config().firebase);
  
      const db = admin.database()
      const ms = admin.messaging()
  
      exports.notifications = functions.database.ref('Notifications/{id}').onUpdate(async(evt) =&gt;{
  
          const payload = {
              notification:{
                  title   : '¡Alarma!',
                  body    : 'Se activó tu cerca, revisala',
                  badge   : '1',
                  sound   :'defaul'   
              }
          };
  
          //Get Notification Device ID
          const notySnap = await db.ref('Notification/').once('value');
  
          var devicee = notySnap.notId;
          var dev = JSON.stringify(devicee);
  
  
          //Get number of users that the device had
          const usersSnap = await db.ref('Devices/'+ dev + '/Users').once('value')
          const nUsers = usersSnap.nUsers;
          var Nusers = JSON.stringify(nUsers);
          var nNUsers = parseInt(Nusers);
  
  
          //Send notification to the number of users that exist
          if (Nusers !== null){
              for(i = 0; 1 &lt;=nNUsers; i++){
  
                  if(i === 1){
                      const userToSendP1 = usersSnap.user1;
                      var userToSend1 = JSON.stringify(userToSendP1);
                      Console.log("Mensaje enviado a user 1");
                      ms.sendToDevice(userToSend1, payload);
                  }else if(i === 2){
                      const userToSendP2 = usersSnap.user2;
                      var userToSend2 = JSON.stringify(userToSendP2);
                      Console.log("Mensaje enviado a user 2");
                      ms.sendToDevice(userToSend2, payload);
                  }else if(i === 3){
                      const userToSendP3 = usersSnap.user3;
                      var userToSend3 = JSON.stringify(userToSendP3);
                      Console.log("Mensaje enviado a user 3");
                      ms.sendToDevice(userToSend3, payload);
                  }else if(i === 4){
                      const userToSendP4 = usersSnap.user4;
                      var userToSend4 = JSON.stringify(userToSendP4);
                      Console.log("Mensaje enviado a user 4");
                      ms.sendToDevice(userToSend4, payload);
                  }
                  /*
                  switch(i){
                      case 1:
                          const userToSendP1 = usersSnap.user1;
                          var userToSend1 = JSON.stringify(userToSendP1);
                          Console.log("Mensaje enviado a user 1");
                          ms.sendToDevice(userToSend1, payload);
                          break;
                      case 2:
                          const userToSendP2 = usersSnap.user2;
                          var userToSend2 = JSON.stringify(userToSendP2);
                          Console.log("Mensaje enviado a user 2");
                          ms.sendToDevice(userToSend2, payload);
                          break;
                      case 3:
                          const userToSendP3 = usersSnap.user3;
                          var userToSend3 = JSON.stringify(userToSendP3);
                          Console.log("Mensaje enviado a user 3");
                          ms.sendToDevice(userToSend3, payload);
                          break;
                      case 4: 
                          const userToSendP4 = usersSnap.user4;
                          var userToSend4 = JSON.stringify(userToSendP4);
                          Console.log("Mensaje enviado a user 4");
                          ms.sendToDevice(userToSend4, payload);
                          break;
                  }*/
              }
          }
          return response.send("Sended Notification").status(200);
      });
  </code></pre>