【发布时间】:2020-07-22 21:27:56
【问题描述】:
我试图使用 Cloud Build 将 Next.JS 应用程序的部署过程自动化到 App Engine,但在 build 阶段它一直失败:
Error: > Build directory is not writeable. https://err.sh/vercel/next.js/build-dir-not-writeable
我似乎不知道要解决什么问题。
我当前的构建文件是,它在第 2 步一直失败:
steps:
# install dependencies
- name: 'gcr.io/cloud-builders/npm'
args: ['install']
# build the container image
- name: 'gcr.io/cloud-builders/npm'
args: ['run', 'build']
# deploy to app engine
- name: "gcr.io/cloud-builders/gcloud"
args: ["app", "deploy"]
env:
- 'PORT=8080'
- 'NODE_ENV=production'
timeout: "1600s"
app.yaml:
runtime: nodejs12
handlers:
- url: /.*
secure: always
script: auto
env_variables:
PORT: 8080
NODE_ENV: 'production'
任何帮助将不胜感激
【问题讨论】:
-
你的 next.js 版本是什么?
-
在我的 app.yaml 中,我已将其指定为使用 v12。我注意到我错过了这个,所以把它添加到我上面的帖子中
-
here 是与 EC2 上的 next.js 相关的问题,他们建议为您的项目目录设置权限 -
sudo chmod 777 -R /your_project_path
标签: next.js google-cloud-build