gcloud应用程序部署因灵活的环境而失败

时间:2019-10-17 08:15:38

标签: php node.js gcloud google-flexible

我已经使用nodejs和php尝试了hello world示例,并且两个标准环境都可以正常工作。但是当我使用'gcloud app deploy'时,两个使用flexible的示例都给出了相同的错误: 错误:gcloud崩溃(TypeError):“ NoneType”和“ int”的实例之间不支持“>”

作品: https://cloud.google.com/nodejs/getting-started/hello-world https://cloud.google.com/appengine/docs/standard/php7/quickstart

失败: https://cloud.google.com/appengine/docs/flexible/nodejs/quickstart https://cloud.google.com/appengine/docs/flexible/php/quickstart

我尝试删除该项目并从头开始(并确保已启用计费)。 gcloud信息显示正确的gmail帐户,并且已设置项目。

我想念什么?

app.yaml

runtime: nodejs
env: flex
manual_scaling:
  instances: 1
resources:
  cpu: 1
  memory_gb: 0.5
  disk_size_gb: 10

app.js

'use strict';

// [START gae_flex_quickstart]
const express = require('express');

const app = express();

app.get('/', (req, res) => {
  res
    .status(200)
    .send('Hello, world!')
    .end();
});

// Start the server
const PORT = process.env.PORT || 8081;
app.listen(PORT, () => {
  console.log(`App listening on port ${PORT}`);
  console.log('Press Ctrl+C to quit.');
});
// [END gae_flex_quickstart]

module.exports = app;

package.json

{
  "name": "appengine-hello-world",
  "description": "Simple Hello World Node.js sample for Google App Engine Flexible Environment.",
  "version": "0.0.1",
  "private": true,
  "license": "Apache-2.0",
  "author": "Google Inc.",
  "repository": {
    "type": "git",
    "url": "https://github.com/GoogleCloudPlatform/nodejs-docs-samples.git"
  },
  "engines": {
    "node": ">=8.0.0"
  },
  "scripts": {
    "start": "node app.js",
    "test": "mocha --exit test/*.test.js"
  },
  "dependencies": {
    "express": "^4.16.3"
  },
  "devDependencies": {
    "mocha": "^6.2.0",
    "supertest": "^4.0.2"
  }
}

0 个答案:

没有答案