I am trying to deploy my Node.js application in firebase but when I run the command it results in the error Error:
runtime field is required but was not found in firebase.json.
I tried running the command firebase serve --only functions,hosting
and everything works fine locally so I would like to deploy and provide the link to my colleagues for the user testing but I am unable to do it using the firebase deploy
command.
I tried adding the command to my firebase.json
file but still no luck. Here is my original firebase.json
file:
{
"hosting": {
"public": "public",
"rewrites": [
{
"source": "**",
"function": "app"
}
]
}
}
After getting the error I changed to this:
{
"hosting": {
"public": "public",
"runtime": "nodejs10",
"rewrites": [
{
"source": "**",
"function": "app"
}
]
}
}
Still getting the error, I am bit confused where exactly I need to add the command "runtime": "nodejs10",
. I tried looking but could not find any relevant article on the similar issue, can anyone please help me.