Just figured it out for my case scenario. I did npm install in the root of my project rather than in the functions folder. Once i did it inside the functions folder, firebase deploy worked just fine :)