0

我已经使用 nodejs 和 php 尝试了 hello world 示例,并且两个标准环境都可以正常工作。但是,当我使用“gcloud app deploy”时,使用灵活的两个示例都会给出相同的错误:错误:gcloud crashed (TypeError): '>' not supported between 'NoneType' and 'int' instances

作品: 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 info 显示正确的 gmail 帐户并设置了项目。

我错过了什么?

应用程序.yaml

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

应用程序.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;

包.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"
  }
}
4

0 回答 0