Given the below cloudbuild file:
- name: 'gcr.io/cloud-builders/npm:node-18.12.0
' dir: 'functions'
entrypoint: npm
args: ['install']
- name: 'gcr.io/cloud-builders/npm:node-18.12.0'
dir: 'functions'
entrypoint: npm
args: ['test']
- name: gcr.io/my-project/firebase
env: ['ENV=development']
args: ['deploy', '--only', 'functions', '--project', 'my-project', '--debug']
timeout: 15m
We getting the below error in Cloud Build:
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.Error: package.json in functions directory has an engines field which is unsupported. Valid choices are: {"node": "10"}, {"node":"12"}, and {"node":"14"}.
Is there anyone who has resolved this issue, that can assist me in debugging?
hey, siba-za
i'm not sure, but i think that my solution may help you, good luck :3
The error indicates that your package.json file in the functions directory contains a value for the engines field that is not supported in your current version of Node.js. To resolve this issue, you need to update this value to a supported version of Node.js.
Here's how you can do that:
1. Open the package.json file in your project in the functions directory.
2. Find the line containing the "engines" field and check what value is specified after the "node" key.
3. Make sure the value matches one of the supported options: {"node": "10"}, {"node": "12"}, or {"node": "14"}.
4. If the value does not match these options, edit it accordingly, for example: {"node": "12"}.
5. Save the changes in the package.json file.
6. After making these changes, try running your Cloud Build again and the error should be resolved.
If the problem persists, make sure your Cloud Build is using an up-to-date version of the Firebase CLI and check other possible places where the engines value may be set or used to make sure it matches a supported version of Node.js.
Hi @JadielMiles ,
Thanks for your response. I have tried your suggestion.
Our problem is that the node versions listed as being supported have been deprecated. We have received notification to upgrade to the latest version on node, which we trying to do.
what is the problem to update to update your node?