I am trying to deploy app engine node service on the flex environment.
Below is my configuration in app.yaml
runtime: nodejs8
env: flex
#to name a service use below syntax
service: exampleNodeApp
env_variables:
NODE_ENV: "dev"
PORT: 3000
skip_files:
.env
manual_scaling:
instances: 1
resources:
cpu: 1
memory_gb: 0.5
disk_size_gb: 10
The config is going to use the node8 image. My package.json
is as below
{
"name": "expressapp",
"version": "1.0.0",
"private": true,
"main": "./bin/www",
"scripts": {
"start": "node ./bin/www",
},
"dependencies": {
"express": "~4.16.3",
}
}
I have tried specifying the engine also like
{
"node": "~8.*"
}
And to see the debug logs i used
gcloud app deploy --version default1 --verbosity=debug
the error which i get is as below. Not able to resolve even after trying everything. My app runs fine on the local. Please help!
--update-- the error log
UnsatisfiedRequirementsError: Your application does not satisfy all of the requirements for a runtime of type [nodejs8]. Please correct the errors and try again.
ERROR: (gcloud.app.deploy) Your application does not satisfy all of the requirements for a runtime of type [nodejs8]. Please correct the errors and try again.
Somewhat wrongly defined (not explicitly) in the google docs.
the runtime: nodejs8
is only available for the standard environment. But for the flex env env: flex
only nodejs can be given as the param. The gcloud run-time builder does not have anything like nodejs8.
Still trying to figure out whats the version of node given runtime: nodejs
.
will update soon.
For further reference here is how I found the solution https://github.com/GoogleCloudPlatform/nodejs-docs-samples/issues/651