When deploying to firebase functions, I had an error occur during post-install
script due to missing dependency. I'll be honest that I was surprised it was even being run. I've come to the realization I don't really understand what gets run during deployment.
I suspect it's something like:
npm install --production
npm run build
The issue I'm having is that it cannot find a dependency for post-install, which i suspect it's not installing dev dependencies.
Are there are a list of things that occur when you push to firebase functions?
As explained in Google Cloud Functions Node documentation, at least this is what they mention:
When you deploy your function, Cloud Functions installs dependencies declared in the package.json file using the npm install command:
npm install --production
And then:
After you deploy, you can perform a custom build step during the function build process by adding a gcp-build script in your package.json file.
When this script is executed, the dependencies in the dependencies and devDependencies fields of your package.json file are available. After executing your custom build step, Cloud Functions removes and regenerates the node_modules folder by only installing the production dependencies declared in the dependencies field of your package.json file.
If there is no gcp-build script in package.json, Cloud Functions just installs production dependencies.
I'm sure I'm missing some steps, but the gcp-build
script was pretty useful to me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With