As per https://firebase.google.com/docs/functions/handle-dependencies :
"If you are deploying through the Firebase CLI, the local node_modules folder is ignored, and you must specify your dependencies in package.json"
Thus, are the dependencies in the package.json installed on deploy in the hosting server?