Hi I have made very basic hello world nodejs app, I have cloned my app on google cloud and able to run app locally on GCP on port 8080, but when I run gcloud app deploy it crashed, I have crosscheck the configuration, I have app.yaml with configration
app.yaml
runtime:nodejs8
vm:true
env:flex
One issue is the you need spaces in the app.yaml
file, this is what causes the error:
ERROR: gcloud crashed (TypeError): expected string or buffer...
First add the spaces:
runtime: nodejs8
vm: true
env: flex
Also you're including deprecated characteristics in the app.yaml
. The vm: true
should be deleted and only use env: flex
.
So the final version of the app.yaml
should be:
runtime: nodejs
env: flex
#plus other config options
If you want to specify the nodejs version, add this to the package.json
:
{
"engines": {
"node": "9.x"
}
}
Please see the details here
Just add 1 space in between keys and values in your App.yaml file
runtime: nodejs8
vm: true
env: flex
It will work :)