I followed the following steps:
The Firebase CLI (Command Line Interface) requires Node.js and npm, which you can install by following the instructions on https
1) Make sure you are exporting the function you are trying to deploy in your index.js file.
2) Write 'use-strict' at the top of your file (index.js) then use console to deploy your function