我尝试了以下文档以在Google云上运行node.js应用程序:https : //cloud.google.com/nodejs/getting-started/hello- world
Node.js运行正常,但是如果我运行,gcloud preview app run app.yaml我会…。
gcloud preview app run app.yaml
File "/Users/me/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 83, in <module> _run_file(__file__, globals()) File "/Users/me/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 79, in _run_file execfile(_PATHS.script_file(script_name), globals_) File "/Users/me/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 1020, in <module> main() File "/Users/me/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 1013, in main dev_server.start(options) File "/Users/me/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 810, in start self._dispatcher.start(options.api_host, apis.port, request_data) File "/Users/me/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/dispatcher.py", line 193, in start _module, port = self._create_module(module_configuration, port) File "/Users/me/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/dispatcher.py", line 278, in _create_module threadsafe_override=threadsafe_override) File "/Users/me/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 1536, in __init__ super(ManualScalingModule, self).__init__(**kwargs) File "/Users/me/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 555, in __init__ self._module_configuration) File "/Users/me/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 259, in _create_instance_factory module_configuration=module_configuration) File "/Users/me/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/vm_runtime_factory.py", line 71, in __init__ 8 if runtime_config_getter().threadsafe else 1, 10) File "/Users/me/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 391, in _get_runtime_config raise ValueError('The --custom_entrypoint flag must be set for ' ValueError: The --custom_entrypoint flag must be set for custom runtimes ERROR: (gcloud.preview.app.run) DevAppSever failed with error code [1]
最新的Google Cloud SDK 0.9.65版本存在一个错误。
您可以使用以下命令还原到Cloud SDK 0.9.64:
gcloud config set component_manager/fixed_sdk_version 0.9.64 gcloud components update
下一个版本应具有此修复程序。
要返回到当前版本的SDK,请运行:
gcloud config unset --scope=installation component_manager/fixed_sdk_version gcloud components update
SDK版本0.9.82的更新
Node.js应用程序不再需要Docker。如果不依赖于AppEngine特定的API,则在本地运行应用的首选方法是:
npm install npm start
在您的app.yaml文件中包括以下内容:
runtime: nodejs vm: true api_version: 1