【发布时间】:2020-09-03 13:16:09
【问题描述】:
警告:您的 package.json 未指定受支持的 Node.js 版本。请将您的应用程序固定到 Node.js 运行时的主要版本。
应用程序检测失败:错误:node.js 检查器:“package.json”的“scripts”部分中的“start”和“server.js”文件均未找到。
我在 package.json 下面添加了 “引擎”: { “节点”:“^13.8.0”, "npm":"^6.13.4" }, app.yaml 文件
# [START runtime]
runtime: nodejs
env: flex
service: dev
handlers:
- url: /.*
secure: always
script: auto
redirect_http_response_code: 301
automatic_scaling:
min_num_instances: 1
max_num_instances: 2
cool_down_period_sec: 60
cpu_utilization:
target_utilization: 0.80
package.json
"scripts": {
"start": "serve -s ./build",
"prestart": "npm i -g serve",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
}
cloudbuild.yaml
steps:
- name: gcr.io/cloud-builders/npm
entrypoint: 'npm'
args: [ install ]
- name: gcr.io/cloud-builders/npm
entrypoint: 'npm'
args: [ run, build, --prod ]
- name: gcr.io/cloud-builders/gcloud
entrypoint: 'npm'
args: [ app, deploy, '[public/app.yaml]', --version=$SHORT_SHA ]
【问题讨论】:
-
你解决了吗?我有同样的问题。我有 package.json 文件,它也有启动脚本。但我仍然遇到同样的错误
标签: node.js google-app-engine runtime