问题
I have a project using Cloud Functions for Firebase, and after updating the Firebase CLI to version 9.0.0, I am getting an error message:
Error: package.json in functions directory has an engines field which is unsupported. Valid choices are: {"node": "10"}, {"node":"12"}, and {"node":"14"}.
Deploys to runtimes below Node.js 10 are now disabled in the Firebase CLI. Existing Node.js 8 functions will stop executing on 2021-03-15. Update existing functions to Node.js 10 or greater as soon as possible.
I understand that node 8 is now unsupported, but I want to keep deploying and running my functions on the Spark payment plan which doesn't require billing until things are shut off on March 15, 2021. How can I do this?
回答1:
Since version 9.0.0, the Firebase CLI has fully removed node 8 as an option. If you can't take the recommended advice of upgrading to node 10 (which requires also upgrading to a payment plan), then you will have to downgrade your CLI, which you can use until node 8 is shut off completely on March 15.
Run this to downgrade to the latest version of the CLI before version 9:
npm install -g firebase-tools@8
This should get you version 8.20.0 of the CLI until you choose to upgrade again.
来源:https://stackoverflow.com/questions/65316988/firebase-cli-deploy-error-deploys-to-runtimes-below-node-js-10-are-now-disable