19

After i upgraded to node 10, i am facing this error when deploy my functions

 Cloud Functions deployment requires the pay-as-you-go (Blaze) billing plan.

Is downgrading node will solve the problem at least temporarily, Is there a way to solve the problem without downgrading??

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
Saher Elgendy
  • 1,519
  • 4
  • 16
  • 27

1 Answers1

39

Change the following in functions/package.json:

"engines": {
  "node": "8"
}

It should solve the problem (for now), the official doc.

TL;DR:

  • Node.js 10. This runtime requires the Blaze pay-as-you-go billing plan. This plan provides generous amounts of invocations, compute time, and internet traffic free of charge. See Cloud Functions pricing.
  • Node.js 8 (deprecated as of June 8, 2020). Deployment of Node.js 8 functions will no longer be allowed after February 15, 2020. Then, executions of already-deployed Node.js 8 functions will stop after March 15, 2021. If you have deployed functions to the Node.js 8 runtime, you're recommended to upgrade to the Node.js 10 runtime.
Matt
  • 61
  • 6
andresmijares
  • 3,658
  • 4
  • 34
  • 40
  • 1
    this worked thank you, now if i need to upgrade to node 10 and use the free offer i should show them my credit card details?? – Saher Elgendy Jul 11 '20 at 17:23
  • 2
    yes, you have to, but you can set limits on your gcp account and have alerts to make sure you know when you hitting your limits – andresmijares Jul 11 '20 at 18:16
  • 2
    As of today, July 16, 2020. Deployment of a newer project with functions in Node.js 8 is happening with the above-mentioned deprecation warning. So, developers, who are willing to deploy a new project with functions without moving to the Blaze plan can still do by Switching node version from 10 to 8. I will try updating it here once firebase stops allowing the newer projects with functions to be deployed without a Blaze plan. – Ujwal Agrawal Jul 16 '20 at 04:30
  • I'm trying to find the file that has this node version but i can't find it can you please tell me how to find it? – Onur Balli Jul 16 '20 at 13:33
  • @OnurBalli your package.json file, take a look at this if you need to get started https://firebase.google.com/docs/functions/get-started – andresmijares Jul 16 '20 at 13:46
  • wow!! Firebase has no more free quota :( without any card. Might use on Node 8 at the momemt – Dharmaraj Jul 19 '20 at 12:33
  • The Node.js 8 runtime is deprecated and will be decommissioned on 2021-03-15. For more information, see: https://firebase.google.com/support/faq#functions-runtime – Matt Aug 04 '20 at 01:49
  • actually this might not help if you are trying to use e.g. scheduled cloud functions (pubsub api) – dkocich Aug 11 '20 at 18:14
  • It is not working for me anymore. I tried to deploy targeting nodejs 8 and it shows a message mentioning the billing account (**The billing account for the owning project is disabled in state absent**). I've added my credit card and keep getting the same message. – Aliton Oliveira Sep 25 '20 at 00:55
  • @AlitonOliveira contact support – andresmijares Sep 25 '20 at 01:06