Reputation: 121
For some reason updating a functions node version doesn't seem to work for me. The package.json in the functions directory has:
"engines": { "node": "14" },
According to the docs this appears to be all I need to do. But when I deploy it always stays at Node 10. Not sure what I am doing wrong. Is there maybe a setting in the Google Cloud Console that overrides this?
Here is the output of the cli when deploying:
i deploying functions
i functions: ensuring required AP cloudfunctions.googleapis.com is enabled...
i functions: ensuring required API cloudbuild.googleapis.com is enabled...
✔ functions: required API cloudbuild.googleapis.com is enabled
✔ functions: required API cloudfunctions.googleapis.com is enabled
i functions: preparing backend/functions directory for uploading...
i functions: packaged backend/functions (234.32 KB) for uploading
i pubsub: ensuring required API pubsub.googleapis.com is enabled...
i scheduler: ensuring required API cloudscheduler.googleapis.com is enabled...
✔ scheduler: required API cloudscheduler.googleapis.com is enabled
✔ pubsub: required API pubsub.googleapis.com is enabled
✔ functions: backend/functions folder uploaded successfully
i functions: updating Node.js 10 function sessions(us-central1)...
✔ functions[sessions(us-central1)]: Successful update operation.
Here is the corresponding function in the GCP console:
Upvotes: 1
Views: 1443
Reputation: 121
I found the issue:
In the firebase.json
file I had the following config for functions:
"functions": {
"runtime": "nodejs10",
"source": "backend/functions",
"ignore": ["*.test.ts", "**/node_modules/**"]
},
After removing the "runtime" everything worked as expected.
Upvotes: 7