似乎没有安装 vue-cli-service 这是我的 cloudbuild.yaml,如果它有帮助的话
步骤:
- name: node
entrypoint: npm
args: ['install']
# Necessary for vue.js projects
- name: node
entrypoint: npm
args: ['install', '-g', '@vue/cli']
- name: node
entrypoint: npm
args: ['test']
- name: node
entrypoint: npm
args: ['run', 'build']
- name: "gcr.io/cloud-builders/gcloud"
args: ["app", "deploy"]
app.yaml:
runtime: nodejs12
handlers:
# Serve all static files with urls ending with a file extension
- url: /(.*\..+)$
static_files: dist/\1
upload: dist/(.*\..+)$ # catch all handler to index.html
- url: /.*
static_files: dist/index.html
upload: dist/index.html
注意:如果您的 package.json 不在您的存储库根目录中,您应该在 npm 命令中将 set 定义为:
- name: node
entrypoint: npm
# --prefix and path:
args: ['install','--prefix','myapp']
如果 app.yaml 也不在根目录中,则用于在 gcloud 中部署:
- name: "gcr.io/cloud-builders/gcloud"
args: ["app", "deploy","myapp/app.yaml"]