"gatsby-source-airtable"运行源节点生命周期时抛出错误



Gatsby项目在本地成功编译,但在netlify中失败:以下是部署的完整日志:

Starting build script
10:25:06 PM: Installing dependencies
10:25:06 PM: Python version set to 2.7
10:25:08 PM: v12.18.0 is already installed.
10:25:08 PM: Now using node v12.18.0 (npm v6.14.4)
10:25:08 PM: Started restoring cached build plugins
10:25:08 PM: Finished restoring cached build plugins
10:25:08 PM: Attempting ruby version 2.7.1, read from environment
10:25:10 PM: Using ruby version 2.7.1
10:25:10 PM: Using PHP version 5.6
10:25:10 PM: Started restoring cached yarn cache
10:25:10 PM: Finished restoring cached yarn cache
10:25:10 PM: Installing yarn at version 1.22.4
10:25:10 PM: Installing Yarn!
10:25:10 PM: > Downloading tarball...
10:25:10 PM: [1/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz --> /tmp/yarn.tar.gz.RWfYIxXOeW
10:25:10 PM:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
10:25:10 PM:                                  Dload  Upload   Total   Spent    Left  Speed
10:25:10 PM:   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
10:25:10 PM: 100    79  100    79    0     0    400      0 --:--:-- --:--:-- --:--:--   401
10:25:11 PM:   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
10:25:11 PM: 100    93  100    93    0     0    167      0 --:--:-- --:--:-- --:--:--   436
10:25:11 PM: 100   625  100   625    0     0    776      0 --:--:-- --:--:-- --:--:--   776
10:25:11 PM: 100 1215k  100 1215k    0     0  1087k      0  0:00:01  0:00:01 --:--:-- 1087k
10:25:11 PM: [2/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz.asc --> /tmp/yarn.tar.gz.RWfYIxXOeW.asc
10:25:11 PM: 100    83  100    83    0     0   1759      0 --:--:-- --:--:-- --:--:--  1759
10:25:11 PM: 100    97  100    97    0     0   1262      0 --:--:-- --:--:-- --:--:--  1262
10:25:11 PM: 100   629  100   629    0     0   6066      0 --:--:-- --:--:-- --:--:--  6066
10:25:11 PM: 100  1028  100  1028    0     0   8951      0 --:--:-- --:--:-- --:--:--  8951
10:25:11 PM: > Verifying integrity...
10:25:11 PM: gpg: Signature made Mon 09 Mar 2020 03:52:13 PM UTC using RSA key ID 69475BAA
10:25:11 PM: gpg: Good signature from "Yarn Packaging <yarn@dan.cx>"
10:25:11 PM: gpg: WARNING: This key is not certified with a trusted signature!
10:25:11 PM: gpg:          There is no indication that the signature belongs to the owner.
10:25:11 PM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907  BBB7 1646 B01B 86E5 0310
10:25:11 PM:      Subkey fingerprint: 6D98 490C 6F1A CDDD 448E  4595 4F77 6793 6947 5BAA
10:25:11 PM: > GPG signature looks good
10:25:11 PM: > Extracting to ~/.yarn...
10:25:11 PM: > Adding to $PATH...
10:25:12 PM: > Successfully installed Yarn 1.22.4! Please open another terminal where the `yarn` command will now be available.
10:25:12 PM: No yarn workspaces detected
10:25:12 PM: Started restoring cached node modules
10:25:12 PM: Finished restoring cached node modules
10:25:12 PM: Installing NPM modules using Yarn version 1.22.4
10:25:13 PM: yarn install v1.22.4
10:25:13 PM: [1/4] Resolving packages...
10:25:14 PM: [2/4] Fetching packages...
10:25:24 PM: warning url-loader@1.1.2: Invalid bin field for "url-loader".
10:25:58 PM: info fsevents@2.3.2: The platform "linux" is incompatible with this module.
10:25:58 PM: info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
10:25:58 PM: info fsevents@1.2.13: The platform "linux" is incompatible with this module.
10:25:58 PM: info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
10:25:58 PM: [3/4] Linking dependencies...
10:25:58 PM: warning " > @apollo/client@3.3.19" has unmet peer dependency "graphql@^14.0.0 || ^15.0.0".
10:25:58 PM: warning "@apollo/client > @graphql-typed-document-node/core@3.1.0" has unmet peer dependency "graphql@^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
10:25:58 PM: warning "@apollo/client > graphql-tag@2.12.4" has unmet peer dependency "graphql@^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
10:25:58 PM: warning " > @n8tb1t/use-scroll-position@1.0.47" has unmet peer dependency "@types/react@*".
10:25:58 PM: warning "gatsby > @typescript-eslint/eslint-plugin > tsutils@3.21.0" has unmet peer dependency "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".
10:25:58 PM: warning "gatsby-source-graphql > @graphql-tools/utils@7.10.0" has unmet peer dependency "graphql@^14.0.0 || ^15.0.0".
10:25:58 PM: warning "gatsby > eslint-plugin-graphql > graphql-config > @endemolshinegroup/cosmiconfig-typescript-loader > ts-node@9.1.1" has unmet peer dependency "typescript@>=2.7".
10:25:58 PM: warning "gatsby-source-graphql > @graphql-tools/links > @graphql-tools/delegate@7.1.5" has unmet peer dependency "graphql@^14.0.0 || ^15.0.0".
10:25:58 PM: warning "gatsby-source-graphql > @graphql-tools/wrap@7.0.8" has unmet peer dependency "graphql@^14.0.0 || ^15.0.0".
10:25:58 PM: warning "gatsby-plugin-sass > sass-loader@7.3.1" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0".
10:25:58 PM: warning "gatsby-source-graphql > @graphql-tools/links@7.1.0" has unmet peer dependency "graphql@^14.0.0 || ^15.0.0".
10:25:58 PM: warning "gatsby-source-graphql > apollo-link@1.2.14" has unmet peer dependency "graphql@^0.11.3 || ^0.12.3 || ^0.13.0 || ^14.0.0 || ^15.0.0".
10:25:58 PM: warning "gatsby-source-graphql > apollo-link-http@1.5.17" has unmet peer dependency "graphql@^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
10:25:58 PM: warning "gatsby-source-graphql > @graphql-tools/links > apollo-upload-client@14.1.3" has unmet peer dependency "graphql@14 - 15".
10:25:58 PM: warning "gatsby-source-graphql > apollo-link > apollo-utilities@1.3.4" has unmet peer dependency "graphql@^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
10:25:58 PM: warning "gatsby-source-graphql > apollo-link-http > apollo-link-http-common@0.2.16" has unmet peer dependency "graphql@^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
10:26:23 PM: [4/4] Building fresh packages...
10:26:30 PM: Done in 77.35s.
10:26:30 PM: NPM modules installed using Yarn
10:26:31 PM: Started restoring cached go cache
10:26:31 PM: Finished restoring cached go cache
10:26:31 PM: go version go1.14.4 linux/amd64
10:26:31 PM: go version go1.14.4 linux/amd64
10:26:31 PM: Installing missing commands
10:26:31 PM: Verify run directory
10:26:31 PM: ​
10:26:31 PM: ────────────────────────────────────────────────────────────────
10:26:31 PM:   Netlify Build                                                 
10:26:31 PM: ────────────────────────────────────────────────────────────────
10:26:31 PM: ​
10:26:31 PM: ❯ Version
10:26:31 PM:   @netlify/build 11.31.1
10:26:31 PM: ​
10:26:31 PM: ❯ Flags
10:26:31 PM:   deployId: 60b905de5191010008d111ad
10:26:31 PM: ​
10:26:31 PM: ❯ Current directory
10:26:31 PM:   /opt/build/repo
10:26:31 PM: ​
10:26:31 PM: ❯ Config file
10:26:31 PM:   No config file was defined: using default values.
10:26:31 PM: ​
10:26:31 PM: ❯ Context
10:26:31 PM:   deploy-preview
10:26:31 PM: ​
10:26:31 PM: ❯ Installing plugins
10:26:31 PM:    - netlify-plugin-gatsby-cache@0.3.0
10:26:32 PM: ​
10:26:32 PM: ❯ Loading plugins
10:26:32 PM:    - netlify-plugin-gatsby-cache@0.3.0 from Netlify app
10:26:32 PM: ​
10:26:32 PM: ────────────────────────────────────────────────────────────────
10:26:32 PM:   1. onPreBuild command from netlify-plugin-gatsby-cache        
10:26:32 PM: ────────────────────────────────────────────────────────────────
10:26:32 PM: ​
10:26:33 PM: No Gatsby cache found. Building fresh.
10:26:33 PM: ​
10:26:33 PM: (netlify-plugin-gatsby-cache onPreBuild completed in 195ms)
10:26:33 PM: ​
10:26:33 PM: ────────────────────────────────────────────────────────────────
10:26:33 PM:   2. Build command from Netlify app                             
10:26:33 PM: ────────────────────────────────────────────────────────────────
10:26:33 PM: ​
10:26:33 PM: $ yarn install && yarn build
10:26:33 PM: yarn install v1.22.4
10:26:33 PM: [1/4] Resolving packages...
10:26:34 PM: success Already up-to-date.
10:26:34 PM: Done in 0.97s.
10:26:34 PM: yarn run v1.22.4
10:26:34 PM: $ gatsby build
10:26:37 PM: success open and validate gatsby-configs - 0.066s
10:26:38 PM: success load plugins - 1.105s
10:26:38 PM: success onPreInit - 0.076s
10:26:38 PM: success delete html and css files from previous builds - 0.010s
10:26:38 PM: success initialize cache - 0.046s
10:26:39 PM: success copy gatsby files - 0.045s
10:26:39 PM: success onPreBootstrap - 0.016s
10:26:39 PM: success createSchemaCustomization - 0.007s
10:26:39 PM: error "gatsby-source-airtable" threw an error while running the sourceNodes lifecycle:
10:26:39 PM: not finished source and transform nodes - 0.866s
10:26:40 PM: error Command failed with exit code 1.
10:26:40 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
10:26:40 PM: ​
10:26:40 PM: ────────────────────────────────────────────────────────────────
10:26:40 PM:   "build.command" failed                                        
10:26:40 PM: ────────────────────────────────────────────────────────────────
10:26:40 PM: ​
10:26:40 PM:   Error message
10:26:40 PM:   Command failed with exit code 1: yarn install && yarn build
10:26:40 PM: ​
10:26:40 PM:   Error location
10:26:40 PM:   In Build command from Netlify app:
10:26:40 PM:   yarn install && yarn build
10:26:40 PM: ​
10:26:40 PM:   Resolved config
10:26:40 PM:   build:
10:26:40 PM:     command: yarn install && yarn build
10:26:40 PM:     commandOrigin: ui
10:26:40 PM:     environment:
10:26:40 PM:       - AIRTABLE_API_KEY
10:26:40 PM:       - AIRTABLE_BASE_ID
10:26:40 PM:       - GATSBY_API_ENDPOINT
10:26:40 PM:       - HP_GRAPHQL_API_ENDPOINT
10:26:40 PM:       - NODE_ENV
10:26:40 PM:       - REVIEW_ID
10:26:40 PM:       - WPGRAPHQL_URL
10:26:40 PM:     publish: /opt/build/repo/public
10:26:40 PM:   functions:
10:26:40 PM:     '*': {}
10:26:40 PM:   plugins:
10:26:40 PM:     - inputs: {}
10:26:40 PM:       origin: ui
10:26:40 PM:       package: netlify-plugin-gatsby-cache
10:26:40 PM: Caching artifacts
10:26:40 PM: Started saving node modules
10:26:40 PM: Finished saving node modules
10:26:40 PM: Started saving build plugins
10:26:40 PM: Finished saving build plugins
10:26:40 PM: Started saving yarn cache
10:26:40 PM: Finished saving yarn cache
10:26:40 PM: Started saving pip cache
10:26:40 PM: Finished saving pip cache
10:26:40 PM: Started saving emacs cask dependencies
10:26:40 PM: Finished saving emacs cask dependencies
10:26:40 PM: Started saving maven dependencies
10:26:40 PM: Finished saving maven dependencies
10:26:40 PM: Started saving boot dependencies
10:26:40 PM: Finished saving boot dependencies
10:26:40 PM: Started saving rust rustup cache
10:26:40 PM: Finished saving rust rustup cache
10:26:40 PM: Started saving go dependencies
10:26:40 PM: Finished saving go dependencies
10:26:43 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
10:26:43 PM: Creating deploy upload records
10:26:43 PM: Failing build: Failed to build site
10:26:43 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
10:26:43 PM: Finished processing build request in 1m42.475761631s

错误显示error "gatsby-source-airtable" threw an error while running the sourceNodes lifecycle,但我不理解这个错误。有人能给我解释一下这里出了什么问题吗?

我在gatsby-config.js 上有下面的airtable配置

{
resolve: `gatsby-source-airtable`,
options: {
apiKey: process.env.AIRTABLE_API_KEY,
concurrency: 5,
tables: [
{
baseId: baseId,
tableName: `Company`,
queryName: true,
tableLinks: [
`Discounts`,
`Company_Logos`;
],
},
{
baseId: baseId,
tableName: `Averages`,
mapping: { Name: `text/markdown` }, // optional, e.g. "text/markdown", "fileNode"
},
{
baseId: baseId,
tableName: `Discounts`,
tableLinks: [`Discount`],
},
],
},
},

依赖项:

"gatsby-source-airtable": "^2.1.1",
"gatsby-source-airtable": "^2.1.1",
"react": "^16.12.0",
"gatsby-source-graphql": "^2.7.6",

我已经尝试删除node_modules和yarn.lock文件并进行重建,尽管它在本地成功构建,但在netlify中失败了。

经过这么多的构建尝试,我意识到netlify env密钥AIRTABLE_API_key已经被更改,修复API密钥解决了这个问题。

注意:使用Netlify cli工具并尝试在本地使用netlify build --debug

相关内容

  • 没有找到相关文章

最新更新