In my case, if you create a nested project with a parent project that has several dependencies installed. Make sure that the dependences are not shared with the child folder (where package.json from the cloud function is used). Internally, your project may not have errors, but when deployed, sharing dependencies will affect cloud functions.