firebase deploy --only functions fails with a generic deploy error
Error: There was an error deploying functionsShort answer
The generic message hides a specific one. Read the lines above it, or the function logs. Check three things: the Node.js version in engines must be one Firebase still supports, large deploys can hit quota errors (HTTP 429 or 500) and should go in groups, and the project must be on the Blaze plan.
Fix it fast
1Find out which cause you have
Re-run the deploy and read the first error line it prints, not the last one. Then check the Node.js version your functions request.
firebase deploy --only functions grep -A2 '"engines"' functions/package.json2Match what you see, then jump to its fix
What does the error look like?
Error: There was an error deploying functionsHTTP 429
Cause 1 of 3
The Node.js runtime is no longer supported
1Check
Firebase lists Node.js 22 and 20 as supported, with 18 deprecated. Node.js 14 and 16 were decommissioned and deploying with them is disabled.
grep -A2 '"engines"' functions/package.json
node --version2Fix
Set a supported version in engines (or runtime in firebase.json), and use firebase-tools 11.18.0 or later.
// functions/package.json
"engines": { "node": "22" }3Verify
Redeploy all functions.
firebase deploy --only functionsConfirmed by firebase.google.com
Cause 2 of 3
Too many functions in one deploy hit a quota
1Check
Deploying a large number of functions at once can exceed the standard quota.
firebase functions:list2Fix
Deploy in groups of 10 functions or fewer, naming them with --only.
firebase deploy --only functions:funcA,functions:funcB3Verify
Each group deploys without the quota error.
firebase functions:listConfirmed by firebase.google.com
Cause 3 of 3
The project is not on the Blaze plan
1Check
Deploying functions requires the pay-as-you-go Blaze plan, and deploys are rate-limited.
firebase use2Fix
Upgrade the project to Blaze in the Firebase console, then deploy again.
firebase deploy --only functions3Verify
The deploy proceeds past the API checks.
firebase functions:listConfirmed by firebase.google.com
How do I stop it coming back?
- Pin the Node.js version in engines and review it when Firebase announces a deprecation.
- Deploy only the functions you changed on large projects.
- Keep firebase-tools, firebase-functions and firebase-admin current.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- WorkforceA field app, an admin console and a self-hosted Node.js server for push and reconciliation.
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- SessionBirdAn omnichannel engagement suite in Flutter: campaigns, chatbot, tickets, analytics and live calling.
Related fixes
Back end
firebase deploy cannot load your functions: user code failed to load
Functions codebase could not be analyzed successfully. It may have a syntax or runtime error
The Firebase CLI loads your functions code on your machine before it deploys, to learn which functions exist.
4 causes, each with a fixBack end
Firebase Cloud Functions respond slowly, especially on the first call
Every function in the project is slow after deploy, even tiny ones
Most slow first calls are cold starts: the runtime starts from scratch, loads your code and runs global-scope work before it can answer.
3 causes, each with a fixBack end
firebase-admin warns that FIREBASE_CONFIG is missing
Warning, FIREBASE_CONFIG environment variable is missing. Initializing firebase-admin will fail
Cloud Functions for Firebase sets FIREBASE_CONFIG for you; a script run with plain node does not have it.
3 causes, each with a fixBack end
firebase deploy cannot load the .env file in the functions folder
FirebaseError: Failed to load environment variables from .env
The CLI reads .env files from the functions folder at deploy time and rejects ones it cannot use.
3 causes, each with a fixBack end
Firebase Functions fails to load because csv-parse/sync is missing
Cannot find module 'csv-parse'
Firebase installs only what the functions package.json lists under dependencies, and it ignores your local node_modules at deploy.
3 causes, each with a fixBack end
firebase deploy rejects the Node.js version in a Cloud Functions package.json
`runtime` field is required but was not found in firebase.json or package.json.
The Firebase CLI builds the runtime name straight from engines.node in package.json, so the value must be a plain version such as 22, and a version that Google has decommissioned is refused.
5 causes, each with a fix