简体   繁体   English

Gatsby 在 Netlify 上构建失败

[英]Gatsby Failed Build on Netlify

I'm using gatsby wordpress experimental and have a build error when I try to upload to Netlify.我正在使用 gatsby wordpress 实验,当我尝试上传到 Netlify 时出现构建错误。

Netlify has told me that it's not an issue with Netlify , but with the build process. Netlify 告诉我这不是 Netlify 的问题,而是构建过程的问题。 However, I cant find my error.但是,我找不到我的错误。

When I clone my git repository, the build works fine locally.当我克隆我的 git 存储库时,构建在本地运行良好。 It just cant get pushed through to Netlify.它只是无法推送到 Netlify。 Netlify support says when he cloned the github repo, he saw the same error as what I'm seeing in my Netlify deploy log, which makes me wonder if I have some global package installed on my computer that isn't going Netlify and causing this error. Netlify 支持人员说,当他克隆 github 存储库时,他看到了与我在 Netlify 部署日志中看到的相同的错误,这让我想知道我是否在我的计算机上安装了一些全局 package 并没有运行 Netlify 并导致此问题错误。

I cant re-create the error on my computer tho.我无法在我的计算机上重新创建错误。 The build works for me.该构建对我有用。

Public Repo: https://github.com/RyanPinPB/pdm-gatsby公共回购: https://github.com/RyanPinPB/pdm-gatsby

The error that I'm stumped on:我被难住的错误:

success write out redirect data - 0.018s
⠁ vips_value_hash: no case for NULL
    type 64, gchararray
    generic 53, GParamString
vips_value_hash: no case for 0.000000
    type 60, gdouble
    generic 109, GParamDouble
vips_value_hash: no case for FALSE
    type 20, gboolean
    generic 76, GParamBoolean
vips_value_hash: no case for ((VipsAccess) VIPS_ACCESS_RANDOM)
    type 73595104, VipsAccess
    generic 80, GParamEnum
vips_value_hash: no case for FALSE
    type 20, gboolean
    generic 76, GParamBoolean
Segmentation fault (core dumped)

Any idea what this error actually means?知道这个错误实际上意味着什么吗?

Here's the full build log from Netlify:这是来自 Netlify 的完整构建日志:

11:01:43 AM: Build ready to start
11:01:45 AM: build-image version: 09c2cdcdf242cf2f57c9ee0fcad9d298fad9ad41
11:01:45 AM: build-image tag: v3.5.0
11:01:45 AM: buildbot version: 8df8a50b1177b0b57364d20e0ea150448924cebf
11:01:45 AM: Fetching cached dependencies
11:01:45 AM: Starting to download cache of 244.2MB
11:01:47 AM: Finished downloading cache in 1.566800161s
11:01:47 AM: Starting to extract cache
11:01:56 AM: Finished extracting cache in 9.099291187s
11:01:56 AM: Finished fetching cache in 10.772692856s
11:01:56 AM: Starting to prepare the repo for build
11:01:56 AM: Preparing Git Reference refs/heads/master
11:01:59 AM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'public' versus 'public/' in the Netlify UI
11:02:00 AM: Starting build script
11:02:00 AM: Installing dependencies
11:02:00 AM: Python version set to 2.7
11:02:00 AM: Started restoring cached node version
11:02:03 AM: Finished restoring cached node version
11:02:04 AM: v12.18.0 is already installed.
11:02:05 AM: Now using node v12.18.0 (npm v6.14.4)
11:02:05 AM: Started restoring cached build plugins
11:02:05 AM: Finished restoring cached build plugins
11:02:05 AM: Attempting ruby version 2.7.1, read from environment
11:02:06 AM: Using ruby version 2.7.1
11:02:06 AM: Using PHP version 5.6
11:02:06 AM: Started restoring cached node modules
11:02:06 AM: Finished restoring cached node modules
11:02:07 AM: Installing NPM modules using NPM version 6.14.4
11:02:30 AM: > sharp@0.26.3 install /opt/build/repo/node_modules/gatsby-plugin-manifest/node_modules/sharp
11:02:30 AM: > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
11:02:31 AM: info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.10.0/libvips-8.10.0-linux-x64.tar.br
11:02:33 AM: > sharp@0.26.3 install /opt/build/repo/node_modules/gatsby-plugin-sharp/node_modules/sharp
11:02:33 AM: > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
11:02:34 AM: info sharp Using cached /opt/buildhome/.npm/_libvips/libvips-8.10.0-linux-x64.tar.br
11:02:36 AM: > core-js-pure@3.8.0 postinstall /opt/build/repo/node_modules/core-js-pure
11:02:36 AM: > node -e "try{require('./postinstall')}catch(e){}"
11:02:36 AM: > core-js@3.8.0 postinstall /opt/build/repo/node_modules/gatsby/node_modules/core-js
11:02:36 AM: > node -e "try{require('./postinstall')}catch(e){}"
11:02:36 AM: > gatsby-telemetry@1.5.1 postinstall /opt/build/repo/node_modules/gatsby-telemetry
11:02:36 AM: > node src/postinstall.js || true
11:02:36 AM: > gatsby-cli@2.14.1 postinstall /opt/build/repo/node_modules/gatsby/node_modules/gatsby-cli
11:02:36 AM: > node scripts/postinstall.js
11:02:36 AM: > gatsby@2.27.3 postinstall /opt/build/repo/node_modules/gatsby
11:02:36 AM: > node scripts/postinstall.js
11:02:39 AM: npm WARN @reach/alert@0.11.0 requires a peer of react@^16.8.0 but none is installed. You must install peer dependencies yourself.
11:02:39 AM: npm WARN @reach/alert@0.11.0 requires a peer of react-dom@^16.8.0 but none is installed. You must install peer dependencies yourself.
11:02:39 AM: npm WARN @reach/auto-id@0.11.0 requires a peer of react@^16.8.0 but none is installed. You must install peer dependencies yourself.
11:02:39 AM: npm WARN @reach/auto-id@0.11.0 requires a peer of react-dom@^16.8.0 but none is installed. You must install peer dependencies yourself.
11:02:39 AM: npm WARN @reach/router@1.3.4 requires a peer of react@15.x || 16.x || 16.4.0-alpha.0911da3 but none is installed. You must install peer dependencies yourself.
11:02:39 AM: npm WARN @reach/router@1.3.4 requires a peer of react-dom@15.x || 16.x || 16.4.0-alpha.0911da3 but none is installed. You must install peer dependencies yourself.
11:02:39 AM: npm WARN @reach/utils@0.11.0 requires a peer of react@^16.8.0 but none is installed. You must install peer dependencies yourself.
11:02:39 AM: npm WARN @reach/utils@0.11.0 requires a peer of react-dom@^16.8.0 but none is installed. You must install peer dependencies yourself.
11:02:39 AM: npm WARN @reach/visually-hidden@0.11.0 requires a peer of react@^16.8.0 but none is installed. You must install peer dependencies yourself.
11:02:39 AM: npm WARN @reach/visually-hidden@0.11.0 requires a peer of react-dom@^16.8.0 but none is installed. You must install peer dependencies yourself.
11:02:39 AM: npm WARN create-react-context@0.3.0 requires a peer of react@^0.14.0 || ^15.0.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
11:02:39 AM: npm WARN framer-motion@2.9.4 requires a peer of react@^16.8 but none is installed. You must install peer dependencies yourself.
11:02:39 AM: npm WARN framer-motion@2.9.4 requires a peer of react-dom@^16.8 but none is installed. You must install peer dependencies yourself.
11:02:39 AM: npm WARN react-clientside-effect@1.2.2 requires a peer of react@^15.3.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
11:02:39 AM: npm WARN react-focus-lock@2.4.1 requires a peer of react@^16.8.0 but none is installed. You must install peer dependencies yourself.
11:02:39 AM: npm WARN react-paginate@6.5.0 requires a peer of react@^16.0.0 but none is installed. You must install peer dependencies yourself.
11:02:39 AM: npm WARN react-remove-scroll@2.4.0 requires a peer of react@^16.8.0 but none is installed. You must install peer dependencies yourself.
11:02:39 AM: npm WARN react-remove-scroll-bar@2.1.0 requires a peer of react@^16.8.0 but none is installed. You must install peer dependencies yourself.
11:02:39 AM: npm WARN react-side-effect@2.1.0 requires a peer of react@^16.3.0 but none is installed. You must install peer dependencies yourself.
11:02:39 AM: npm WARN react-style-singleton@2.1.0 requires a peer of react@^16.8.0 but none is installed. You must install peer dependencies yourself.
11:02:39 AM: npm WARN ts-node@9.0.0 requires a peer of typescript@>=2.7 but none is installed. You must install peer dependencies yourself.
11:02:39 AM: npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
11:02:39 AM: npm WARN use-callback-ref@1.2.4 requires a peer of react@^16.8.0 but none is installed. You must install peer dependencies yourself.
11:02:39 AM: npm WARN use-sidecar@1.0.3 requires a peer of react@^16.8.0 but none is installed. You must install peer dependencies yourself.
11:02:39 AM: npm WARN using-gatsby-source-wordpress-experimental@0.0.1 No repository field.
11:02:39 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
11:02:39 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
11:02:39 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/chokidar/node_modules/fsevents):
11:02:39 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
11:02:39 AM: added 132 packages from 208 contributors, removed 196 packages, updated 169 packages and audited 2539 packages in 31.091s
11:02:40 AM: 147 packages are looking for funding
11:02:40 AM:   run `npm fund` for details
11:02:40 AM: found 0 vulnerabilities
11:02:40 AM: NPM modules installed
11:02:41 AM: Started restoring cached go cache
11:02:41 AM: Finished restoring cached go cache
11:02:41 AM: go version go1.14.4 linux/amd64
11:02:41 AM: go version go1.14.4 linux/amd64
11:02:41 AM: Installing missing commands
11:02:41 AM: Verify run directory
11:02:42 AM: ​
11:02:42 AM: ────────────────────────────────────────────────────────────────
11:02:42 AM:   Netlify Build                                                 
11:02:42 AM: ────────────────────────────────────────────────────────────────
11:02:42 AM: ​
11:02:42 AM: ❯ Version
11:02:42 AM:   @netlify/build 5.3.3
11:02:42 AM: ​
11:02:42 AM: ❯ Flags
11:02:42 AM:   deployId: 5fbeaa17e73bf00007ce6dab
11:02:42 AM:   mode: buildbot
11:02:42 AM: ​
11:02:42 AM: ❯ Current directory
11:02:42 AM:   /opt/build/repo
11:02:42 AM: ​
11:02:42 AM: ❯ Config file
11:02:42 AM:   No config file was defined: using default values.
11:02:42 AM: ​
11:02:42 AM: ❯ Context
11:02:42 AM:   production
11:02:42 AM: ​
11:02:42 AM: ────────────────────────────────────────────────────────────────
11:02:42 AM:   1. Build command from Netlify app                             
11:02:42 AM: ────────────────────────────────────────────────────────────────
11:02:42 AM: ​
11:02:42 AM: $ gatsby build
11:02:46 AM: success open and validate gatsby-configs - 0.043s
11:02:47 AM: success load plugins - 1.200s
11:02:47 AM: plugin-netlify-cache: Restoring 46 cached files for .cache directory with 0 already existing files.
11:02:48 AM: plugin-netlify-cache: Netlify cache restored
11:02:48 AM: success onPreInit - 1.074s
11:02:48 AM: success delete html and css files from previous builds - 0.003s
11:02:48 AM: info We've detected that the Gatsby cache is incomplete (the .cache directory existsbut the public directory does not). As a precaution, we're deleting your site's
11:02:48 AM: cache to ensure there's no stale data.success initialize cache - 0.166s
11:02:49 AM: success copy gatsby files - 0.036s
11:02:49 AM: success onPreBootstrap - 0.014s
11:02:52 AM: ⠀
11:02:52 AM: info  gatsby-source-wordpress 
11:02:52 AM:    This is either your first build or the cache was cleared.
11:02:52 AM:    Please wait while your WordPress data is synced to your Gatsby cache.
11:02:52 AM:    Maybe now's a good time to get up and stretch? :D
11:02:54 AM: success  gatsby-source-wordpress  writing GraphQL queries to disk at ./WordPress/GraphQL/ - 0.234s
11:02:54 AM: success  gatsby-source-wordpress  ingest WPGraphQL schema - 2.765s
11:02:54 AM: success createSchemaCustomization - 5.075s
11:02:55 AM: success  gatsby-source-wordpress  Comment - 0.806s - fetched 1
11:02:56 AM: success  gatsby-source-wordpress  User - 2.085s - fetched 1
11:02:57 AM: success  gatsby-source-wordpress  fetch root fields - 2.642s
11:02:57 AM: success  gatsby-source-wordpress  Menu - 2.830s - fetched 2
11:02:57 AM: success  gatsby-source-wordpress  ContentType - 2.884s - fetched 3
11:02:57 AM: success  gatsby-source-wordpress  Category - 2.914s - fetched 1
11:02:57 AM: success  gatsby-source-wordpress  MenuItem - 2.973s - fetched 10
11:02:57 AM: success  gatsby-source-wordpress  UserRole - 3.277s - fetched 0
11:02:57 AM: success  gatsby-source-wordpress  PostFormat - 3.282s - fetched 0
11:02:57 AM: success  gatsby-source-wordpress  Tag - 3.299s - fetched 0
11:02:57 AM: success  gatsby-source-wordpress  Taxonomy - 3.316s - fetched 3
11:02:57 AM: success  gatsby-source-wordpress  Post - 3.368s - fetched 2
11:02:57 AM: success  gatsby-source-wordpress  Page - 3.395s - fetched 6
11:02:59 AM: success  gatsby-source-wordpress  MediaItem - 1.148s - fetched 1
11:02:59 AM: success  gatsby-source-wordpress  creating nodes - 1.149s
11:02:59 AM: success  gatsby-source-wordpress  fetching nodes - 4.550s - 30 total
11:02:59 AM: success Downloading remote files - 0.400s - 1/1 2.50/s
11:02:59 AM: success Checking for changed pages - 0.000s
11:02:59 AM: success source and transform nodes - 4.942s
11:02:59 AM: success building schema - 0.674s
11:02:59 AM: info Total nodes: 149, SitePage nodes: 9 (use --verbose for breakdown)
11:02:59 AM: success createPages - 0.090s
11:02:59 AM: success Checking for changed pages - 0.000s
11:02:59 AM: success createPagesStatefully - 0.092s
11:03:00 AM: success update schema - 0.036s
11:03:00 AM: success onPreExtractQueries - 0.001s
11:03:01 AM: success extract queries from components - 1.046s
11:03:01 AM: success write out redirect data - 0.001s
11:03:01 AM: vips_value_hash: no case for NULL
11:03:01 AM:    type 64, gchararray
11:03:01 AM:    generic 53, GParamString
11:03:01 AM: vips_value_hash: no case for 0.000000
11:03:01 AM:    type 60, gdouble
11:03:01 AM:    generic 109, GParamDouble
11:03:01 AM: vips_value_hash: no case for FALSE
11:03:01 AM:    type 20, gboolean
11:03:01 AM:    generic 76, GParamBoolean
11:03:01 AM: vips_value_hash: no case for ((VipsAccess) VIPS_ACCESS_RANDOM)
11:03:01 AM:    type 82052320, VipsAccess
11:03:01 AM:    generic 80, GParamEnum
11:03:01 AM: vips_value_hash: no case for FALSE
11:03:01 AM:    type 20, gboolean
11:03:01 AM:    generic 76, GParamBoolean
11:03:02 AM: ​
11:03:02 AM: ────────────────────────────────────────────────────────────────
11:03:02 AM:   "build.command" failed                                        
11:03:02 AM: ────────────────────────────────────────────────────────────────
11:03:02 AM: ​
11:03:02 AM:   Error message
11:03:02 AM:   Command was killed with SIGSEGV (Segmentation fault): gatsby build
11:03:02 AM: ​
11:03:02 AM:   Error location
11:03:02 AM:   In Build command from Netlify app:
11:03:02 AM:   gatsby build
11:03:02 AM: ​
11:03:02 AM:   Resolved config
11:03:02 AM:   build:
11:03:02 AM:     command: gatsby build
11:03:02 AM:     commandOrigin: ui
11:03:02 AM:     publish: /opt/build/repo/public
11:03:02 AM: Caching artifacts
11:03:02 AM: Started saving node modules
11:03:02 AM: Finished saving node modules
11:03:02 AM: Started saving build plugins
11:03:02 AM: Finished saving build plugins
11:03:02 AM: Started saving pip cache
11:03:02 AM: Finished saving pip cache
11:03:02 AM: Started saving emacs cask dependencies
11:03:02 AM: Finished saving emacs cask dependencies
11:03:02 AM: Started saving maven dependencies
11:03:02 AM: Finished saving maven dependencies
11:03:02 AM: Started saving boot dependencies
11:03:02 AM: Finished saving boot dependencies
11:03:02 AM: Started saving go dependencies
11:03:02 AM: Finished saving go dependencies
11:03:02 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
11:03:02 AM: Failing build: Failed to build site
11:03:02 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2
11:03:02 AM: Finished processing build request in 1m16.889531876s

Here's a screenshot of my Netlify deploy settings:这是我的 Netlify 部署设置的屏幕截图: PDM-Gatsby Netlify 部署设置

So I've changed nothing in my project, or the gitHub page, but just setting up Netlify's CLI and using "netlify deploy" instead of the auto-deploy on git push setting solved it所以我没有改变我的项目或 gitHub 页面,但只是设置 Netlify 的 CLI 并使用“netlify deploy”而不是 git 上的自动部署推送设置解决了它

Thanks @DarioRega for getting me to think about that.感谢@DarioRega 让我思考这个问题。

So something between github and netlify might have caused the issue?那么 github 和 netlify 之间的某些东西可能导致了这个问题? I'm not sure我不确定

Using Netlify's CLI was way faster for deploying too (compared to pushing to github and triggering an auto-deploy)使用 Netlify 的 CLI 进行部署也更快(与推送到 github 并触发自动部署相比)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM