作者:雪天使杨果果 | 来源:互联网 | 2022-11-30 11:16
我正在尝试在Flex环境上部署App Engine节点服务。下面是我的配置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
该配置将使用node8映像。我package.json
的如下
{
"name": "expressapp",
"version": "1.0.0",
"private": true,
"main": "./bin/www",
"scripts": {
"start": "node ./bin/www",
},
"dependencies": {
"express": "~4.16.3",
}
}
我尝试指定引擎也喜欢
{
"node": "~8.*"
}
并查看我使用的调试日志
gcloud app deploy --version default1 --verbosity=debug
我得到的错误如下。尝试一切后仍无法解决。我的应用程序在本地运行良好。请帮忙!
--update--错误日志
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.
Somangshu Go..
6
在google文档中有一些错误定义(未明确定义)。
将runtime: nodejs8
仅适用于标准的环境。但是对于flex env,env: flex
只能将nodejs用作参数。gcloud运行时构建器没有类似nodejs8的东西。
仍在尝试弄清给定节点的版本runtime: nodejs
。
即将更新。
为了进一步参考,这里是我找到解决方案的方式
https://github.com/GoogleCloudPlatform/nodejs-docs-samples/issues/651
1> Somangshu Go..:
在google文档中有一些错误定义(未明确定义)。
将runtime: nodejs8
仅适用于标准的环境。但是对于flex env,env: flex
只能将nodejs用作参数。gcloud运行时构建器没有类似nodejs8的东西。
仍在尝试弄清给定节点的版本runtime: nodejs
。
即将更新。
为了进一步参考,这里是我找到解决方案的方式
https://github.com/GoogleCloudPlatform/nodejs-docs-samples/issues/651