Netlify部署在Gatsby构建上失败

时间:2020-01-28 22:00:37

标签: dns command gatsby continuous-deployment netlify

4:51:19 PM: Build ready to start
4:51:21 PM: build-image version: 9cade8af58c2cf3a17a1e9433d2e979149488837
4:51:21 PM: build-image tag: v3.3.5
4:51:21 PM: buildbot version: 036f37945d6de439a17a554b3ae02e2f8f0f1fb0
4:51:21 PM: Fetching cached dependencies
4:51:21 PM: Starting to download cache of 254.9KB
4:51:21 PM: Finished downloading cache in 87.118057ms
4:51:21 PM: Starting to extract cache
4:51:21 PM: Failed to fetch cache, continuing with build
4:51:21 PM: Starting to prepare the repo for build
4:51:21 PM: No cached dependencies found. Cloning fresh repo
4:51:21 PM: git clone https://github.com/AlexanderArchambeault/paintingslive2
4:51:22 PM: Preparing Git Reference refs/heads/master
4:51:23 PM: Starting build script
4:51:23 PM: Installing dependencies
4:51:24 PM: Downloading and installing node v10.18.1...
4:51:24 PM: Downloading https://nodejs.org/dist/v10.18.1/node-v10.18.1-linux-x64.tar.xz...
4:51:25 PM: 
####################################################
4:51:25 PM:                   72.5%
4:51:25 PM: 
###############################################
4:51:25 PM: ######################### 100.0%
4:51:25 PM: Computing checksum with sha256sum
4:51:25 PM: Checksums matched!
4:51:27 PM: Now using node v10.18.1 (npm v6.13.4)
4:51:27 PM: Attempting ruby version 2.6.2, read from environment
4:51:29 PM: Using ruby version 2.6.2
4:51:29 PM: Using PHP version 5.6
4:51:29 PM: Started restoring cached go cache
4:51:29 PM: Finished restoring cached go cache
4:51:29 PM: unset GOOS;
4:51:29 PM: unset GOARCH;
4:51:29 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
4:51:29 PM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
4:51:29 PM: go version >&2;
4:51:29 PM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
4:51:29 PM: go version go1.12 linux/amd64
4:51:29 PM: Installing missing commands
4:51:29 PM: Verify run directory
4:51:29 PM: Executing user command: gatsby build
4:51:29 PM: /usr/local/bin/build: line 64: gatsby: command not found
4:51:29 PM: Skipping functions preparation step: no functions directory set
4:51:29 PM: Caching artifacts
4:51:29 PM: Started saving pip cache
4:51:29 PM: Finished saving pip cache
4:51:29 PM: Started saving emacs cask dependencies
4:51:29 PM: Finished saving emacs cask dependencies
4:51:29 PM: Started saving maven dependencies
4:51:29 PM: Finished saving maven dependencies
4:51:29 PM: Started saving boot dependencies
4:51:29 PM: Finished saving boot dependencies
4:51:29 PM: Started saving go dependencies
4:51:29 PM: Finished saving go dependencies
4:51:32 PM: Error running command: Build script returned non-zero exit code: 127
4:51:32 PM: Failing build: Failed to build site
4:51:32 PM: failed during stage 'building site': Build script returned non-zero exit code: 127
4:51:32 PM: Finished processing build request in 11.100770754s

因此该错误不会消失,它一定是“ / usr / local / bin / build:第64行:gatsby:找不到命令”和与Linux不兼容的问题。但是我一直在这个网站上忙碌着,只得到部署错误!与我一起解决此问题的任何帮助将非常感激。

1 个答案:

答案 0 :(得分:0)

我有同样的错误。这可能不是不兼容。该错误告诉您,在指定的存储库目录中,build命令找不到启动gatsby构建过程的文件,因为它们不存在。

默认情况下,Netlify (see docs)假设您的gatsby项目位于链接存储库的根目录。如果它位于/projectFolder/这样的文件夹中,则需要告诉netlify:

  • 转到https://app.netlify.com/sites/yourSite/settings/deploys

  • 编辑设置>

Base directory: projectFolder

Publish directory: projectFolder/public