Title: Engines field is required but was not found in functions\package.json
Tags: javascript;node.js
Question: I have this error. Please help me.
Engines field is required but was not found in functions\package.json.
To fix this, add the following lines to your package.json:
"engines": {
"node": "8"
}
my package.json
"name": "functions",
"description": "Cloud Functions for Firebase",
"dependencies": {
"firebase-admin": "^6.0.0",
"firebase-functions": "^2.0.4",
"lodash": "^4.17.10"
"private": true


Here is another answer: === Deploying to 'datingmuslimanetchat'...
i  deploying functions
i  functions: ensuring necessary APIs are enabled...
+  functions: all necessary APIs are enabled
i  functions: preparing functions directory for uploading...
Error: package.json in functions directory has an engines field which is unsupported. The only valid choices are: {"node": "8"} and {"node": "10"}. Note that Node.js 6 is now deprecated.
PS C:\Users\samir\Desktop\folder>

Here is another answer: You should insert the node engines into your package.json. Try this:
"name": "functions",
"description": "Cloud Functions for Firebase",
"dependencies": {
"firebase-admin": "^6.0.0",
"firebase-functions": "^2.0.4",
"lodash": "^4.17.10"
},
"engines": {
"node": "&gt;= 8.0.0"
},
"private": true
For more information, checkout the documentation if you're interested.
Edit:
Some commenters mentioned that setting the node version sould be done without the decimals. So try:
"engines": {
"node": "&gt;= 8"
Comment for this answer: Error: package.json in functions directory has an engines field which is unsupported. The only valid choices are: {"node": "8"} and {"node": "10"}. Note that Node.js 6 is now deprecated.
Comment for this answer: Yes - The reason I commented this Error message, was to point out that the command expects node to be exactly ```{"node": "8"}``` and not as in your answer suggestet ```{"node": ">= 8.0.0"}```. Following the Error Message's integer 8 resolved my issue. You could validate this soultion and check if the ```{"node": ">= 8.0.0"}``` you suggested works or not and then maybe update your original answer if it realy only accepts ```{"node": "8"}```
Comment for this answer: Try typing ```npm i``` into the console. Then run it again.
Comment for this answer: Have you visited the linked website & enabled the Service Usage API?
Comment for this answer: Are you using the correct Google use account? Also, try clearing the cache in the browser.
Comment for this answer: I'm not sure. He didn't provide much information on what he was doing. So I just assumed it had something to do with the package.
Comment for this answer: Did you try using `"node": "8"`? @SeverinKlug
Comment for this answer: Okay, thanks for the update. I'll add that to my solution. @SeverinKlug
Comment for this answer: Just curious, why `engines` field is required? The npm document doesn't mention anything about when it is required.
Comment for this answer: hello i have this errori  deploying functions
i  functions: ensuring necessary APIs are enabled...
Error: HTTP Error: 403, Service Usage API has not been used in project 563584335869 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/serviceusage.googleapis.com/overview?project=5636758433655869 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
PS C:\Users\samir\Desktop\nuovacartella\functions>
Comment for this answer: I have the same mistake
Comment for this answer: Error: HTTP Error: 403, Service Usage API has not been used in project 563584335869 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/serviceusage.googleapis.com/overview?project=563584335869 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
PS C:\Users\samir\Desktop\nuovacartella\functions>
Comment for this answer: get an error when I open the browser
Upload failed.
An error occurred while loading /apis/api/serviceusage.googleapis.com/overview?project=563584335869. Try again.
Comment for this answer: === Deploying to 'datingmuslimanetchat'...
i  deploying functions
i  functions: ensuring necessary APIs are enabled...
+  functions: all necessary APIs are enabled
i  functions: preparing functions directory for uploading...
Error: package.json in functions directory has an engines field which is unsupported. The only valid choices are: {"node": "8"} and {"node": "10"}. Note that Node.js 6 is now deprecated.
PS C:\Users\samir\Desktop\folder>

Here is another answer: Need update firebase cli;
npm install -g firebase-tools
Reference:
https://firebase.google.com/docs/cli#macos

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 3, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2019:00:07/12/19', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<javascript><node.js>', 'Title': 'Engines field is required but was not found in functions\\package.json', 'ViewCount': 3822, 'id': 56998771, 'user_AboutMe': None, 'user_AccountId': 6255183.0, 'user_DisplayName': 'samir', 'user_Reputation': 41.0, 'user_Views': 10.0, 'user_id': 4864030.0}}