Hi, I know it’s experimental but I just wanted to try. I followed all the instruction here:
1.installed npm install @netlify/gatsby-runner
2. add netlify toml file with the plugin
3. change the build command to “build” : “gatsby-runner”
Then I tried a local npm run build
and it seems to work as expected. See end of the log below:
╭────────────────────────────────────────────────────────────────╮
│ │
│ (SSG) Generated at build time │
│ D (DSG) Deferred static generation - page generated at runtime │
│ ∞ (SSR) Server-side renders at runtime (uses getServerData) │
│ λ (Function) Gatsby function │
│ │
╰────────────────────────────────────────────────────────────────╯
Deferred processing 1640 images until runtime. Moved 534 originals
Built site using the experimental Netlify Gatsby build runner.
Please report any issues: https://ntl.fyi/gatsby-runner
But when I pushed everything to netlify I got some errors. Here is the log:
1:52:55 PM: Build ready to start
1:52:56 PM: build-image version: ac716c5be7f79fe384a0f3759e8ef612cb821a37 (xenial)
1:52:56 PM: build-image tag: v3.13.0
1:52:56 PM: buildbot version: 515e5c33287d8b909c004fcf2e460e8645e8c1c6
1:52:56 PM: Fetching cached dependencies
1:52:56 PM: Failed to fetch cache, continuing with build
1:52:56 PM: Starting to prepare the repo for build
1:52:57 PM: No cached dependencies found. Cloning fresh repo
1:52:57 PM: git clone https://github.com/AnnieTaylorCHEN/petiteandminimalblog
1:53:00 PM: Preparing Git Reference refs/heads/master
1:53:02 PM: Parsing package.json dependencies
1:53:03 PM: Starting build script
1:53:03 PM: Installing dependencies
1:53:03 PM: Python version set to 2.7
1:53:04 PM: Downloading and installing node v14.19.3...
1:53:04 PM: Downloading https://nodejs.org/dist/v14.19.3/node-v14.19.3-linux-x64.tar.xz...
1:53:04 PM: Computing checksum with sha256sum
1:53:05 PM: Checksums matched!
1:53:07 PM: Now using node v14.19.3 (npm v6.14.17)
1:53:07 PM: Started restoring cached build plugins
1:53:07 PM: Finished restoring cached build plugins
1:53:08 PM: Attempting ruby version 2.6.2, read from environment
1:53:09 PM: Using ruby version 2.6.2
1:53:09 PM: Using PHP version 5.6
1:53:09 PM: No npm workspaces detected
1:53:09 PM: Started restoring cached node modules
1:53:09 PM: Finished restoring cached node modules
1:53:10 PM: Installing NPM modules using NPM version 6.14.17
2:06:19 PM: npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
2:06:19 PM: > @parcel/watcher@2.0.5 install /opt/build/repo/node_modules/@parcel/watcher
2:06:19 PM: > node-gyp-build
2:06:19 PM: > msgpackr-extract@1.1.4 install /opt/build/repo/node_modules/msgpackr-extract
2:06:19 PM: > node-gyp-build-optional-packages
2:06:20 PM: > lmdb@2.3.10 install /opt/build/repo/node_modules/@parcel/cache/node_modules/lmdb
2:06:20 PM: > node-gyp-build-optional-packages
2:06:20 PM: > lmdb@2.5.2 install /opt/build/repo/node_modules/lmdb
2:06:20 PM: > node-gyp-build-optional-packages
2:06:20 PM: > sharp@0.30.7 install /opt/build/repo/node_modules/sharp
2:06:20 PM: > (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
2:06:22 PM: sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.12.2/libvips-8.12.2-linux-x64.tar.br
2:06:22 PM: sharp: Integrity check passed for linux-x64
2:06:23 PM: > core-js@2.6.12 postinstall /opt/build/repo/node_modules/babel-runtime/node_modules/core-js
2:06:23 PM: > node -e "try{require('./postinstall')}catch(e){}"
2:06:23 PM: > core-js@3.23.3 postinstall /opt/build/repo/node_modules/core-js
2:06:23 PM: > node -e "try{require('./postinstall')}catch(e){}"
2:06:23 PM: > core-js-pure@3.19.1 postinstall /opt/build/repo/node_modules/core-js-pure
2:06:23 PM: > node -e "try{require('./postinstall')}catch(e){}"
2:06:24 PM: > gatsby-telemetry@3.17.0 postinstall /opt/build/repo/node_modules/gatsby-telemetry
2:06:24 PM: > node src/postinstall.js || true
2:06:24 PM: > gatsby-cli@4.17.1 postinstall /opt/build/repo/node_modules/gatsby-cli
2:06:24 PM: > node scripts/postinstall.js
2:06:24 PM: > gatsby@4.17.2 postinstall /opt/build/repo/node_modules/gatsby
2:06:24 PM: > node scripts/postinstall.js
2:06:24 PM: > annies-gatsby-starter-default@0.1.0 prepare /opt/build/repo
2:06:24 PM: > husky install
2:06:24 PM: husky - Git hooks installed
2:06:26 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: msgpackr-extract-win32-x64@1.1.0 (node_modules/msgpackr-extract-win32-x64):
2:06:26 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for msgpackr-extract-win32-x64@1.1.0: wanted {"os":"win32","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2:06:26 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: msgpackr-extract-linux-arm64@1.1.0 (node_modules/msgpackr-extract-linux-arm64):
2:06:26 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for msgpackr-extract-linux-arm64@1.1.0: wanted {"os":"linux","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
2:06:26 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: msgpackr-extract-linux-arm@1.1.0 (node_modules/msgpackr-extract-linux-arm):
2:06:26 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for msgpackr-extract-linux-arm@1.1.0: wanted {"os":"linux","arch":"arm"} (current: {"os":"linux","arch":"x64"})
2:06:26 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: msgpackr-extract-darwin-x64@1.1.0 (node_modules/msgpackr-extract-darwin-x64):
2:06:26 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for msgpackr-extract-darwin-x64@1.1.0: wanted {"os":"darwin","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2:06:26 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: msgpackr-extract-darwin-arm64@1.1.0 (node_modules/msgpackr-extract-darwin-arm64):
2:06:26 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for msgpackr-extract-darwin-arm64@1.1.0: wanted {"os":"darwin","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
2:06:26 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: lmdb-win32-x64@2.3.10 (node_modules/lmdb-win32-x64):
2:06:26 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for lmdb-win32-x64@2.3.10: wanted {"os":"win32","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2:06:26 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: lmdb-linux-arm64@2.3.10 (node_modules/lmdb-linux-arm64):
2:06:26 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for lmdb-linux-arm64@2.3.10: wanted {"os":"linux","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
2:06:26 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: lmdb-linux-arm@2.3.10 (node_modules/lmdb-linux-arm):
2:06:26 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for lmdb-linux-arm@2.3.10: wanted {"os":"linux","arch":"arm"} (current: {"os":"linux","arch":"x64"})
2:06:26 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: lmdb-darwin-x64@2.3.10 (node_modules/lmdb-darwin-x64):
2:06:26 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for lmdb-darwin-x64@2.3.10: wanted {"os":"darwin","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2:06:26 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: lmdb-darwin-arm64@2.3.10 (node_modules/lmdb-darwin-arm64):
2:06:26 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for lmdb-darwin-arm64@2.3.10: wanted {"os":"darwin","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
2:06:26 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
2:06:26 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
2:06:26 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @lmdb/lmdb-win32-x64@2.5.2 (node_modules/@lmdb/lmdb-win32-x64):
2:06:26 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @lmdb/lmdb-win32-x64@2.5.2: wanted {"os":"win32","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2:06:26 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @lmdb/lmdb-linux-arm64@2.5.2 (node_modules/@lmdb/lmdb-linux-arm64):
2:06:26 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @lmdb/lmdb-linux-arm64@2.5.2: wanted {"os":"linux","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
2:06:26 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @lmdb/lmdb-linux-arm@2.5.2 (node_modules/@lmdb/lmdb-linux-arm):
2:06:26 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @lmdb/lmdb-linux-arm@2.5.2: wanted {"os":"linux","arch":"arm"} (current: {"os":"linux","arch":"x64"})
2:06:26 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @lmdb/lmdb-darwin-x64@2.5.2 (node_modules/@lmdb/lmdb-darwin-x64):
2:06:26 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @lmdb/lmdb-darwin-x64@2.5.2: wanted {"os":"darwin","arch":"x64"} (current: {"os":"linux","arch":"x64"})
2:06:26 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @lmdb/lmdb-darwin-arm64@2.5.2 (node_modules/@lmdb/lmdb-darwin-arm64):
2:06:26 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @lmdb/lmdb-darwin-arm64@2.5.2: wanted {"os":"darwin","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
2:06:26 PM: added 1945 packages from 1218 contributors and audited 1964 packages in 795.955s
2:06:27 PM: 320 packages are looking for funding
2:06:27 PM: run `npm fund` for details
2:06:28 PM: found 16 vulnerabilities (9 moderate, 7 high)
2:06:28 PM: run `npm audit fix` to fix them, or `npm audit` for details
2:06:28 PM: NPM modules installed
2:06:28 PM: Started restoring cached go cache
2:06:28 PM: Finished restoring cached go cache
2:06:28 PM: Installing Go version 1.12
2:06:33 PM: unset GOOS;
2:06:33 PM: unset GOARCH;
2:06:33 PM: export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64';
2:06:33 PM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64/bin:${PATH}";
2:06:33 PM: go version >&2;
2:06:33 PM: export GIMME_ENV="/opt/buildhome/.gimme_cache/env/go1.12.linux.amd64.env"
2:06:33 PM: go version go1.12 linux/amd64
2:06:33 PM: Installing missing commands
2:06:33 PM: Verify run directory
2:06:34 PM:
2:06:34 PM: ────────────────────────────────────────────────────────────────
2:06:34 PM: Netlify Build
2:06:34 PM: ────────────────────────────────────────────────────────────────
2:06:34 PM:
2:06:34 PM: ❯ Version
2:06:34 PM: @netlify/build 27.3.0
2:06:34 PM:
2:06:34 PM: ❯ Flags
2:06:34 PM: baseRelDir: true
2:06:34 PM: buildId: 62bee016fbdd2f53cb3af14a
2:06:34 PM: deployId: 62bee016fbdd2f53cb3af14c
2:06:34 PM:
2:06:34 PM: ❯ Current directory
2:06:34 PM: /opt/build/repo
2:06:34 PM:
2:06:34 PM: ❯ Config file
2:06:34 PM: /opt/build/repo/netlify.toml
2:06:34 PM:
2:06:34 PM: ❯ Context
2:06:34 PM: production
2:06:35 PM:
2:06:35 PM: ❯ Installing plugins
2:06:35 PM: - netlify-plugin-no-more-404@0.0.15
2:06:35 PM: - @netlify/plugin-gatsby@3.2.4
2:06:51 PM:
2:06:51 PM: ❯ Loading plugins
2:06:51 PM: - netlify-plugin-no-more-404@0.0.15 from Netlify app
2:06:51 PM: - @netlify/plugin-gatsby@3.2.4 from Netlify app
2:06:51 PM: - @netlify/gatsby-runner@1.1.10 from netlify.toml and package.json
2:06:54 PM:
2:06:54 PM: ────────────────────────────────────────────────────────────────
2:06:54 PM: 1. @netlify/plugin-gatsby (onPreBuild event)
2:06:54 PM: ────────────────────────────────────────────────────────────────
2:06:54 PM:
2:06:54 PM: No Gatsby cache found. Building fresh.
2:06:54 PM:
2:06:54 PM: (@netlify/plugin-gatsby onPreBuild completed in 138ms)
2:06:54 PM:
2:06:54 PM: ────────────────────────────────────────────────────────────────
2:06:54 PM: 2. Build command from Netlify app
2:06:54 PM: ────────────────────────────────────────────────────────────────
2:06:54 PM:
2:06:54 PM: $ npm run build
2:06:55 PM: > annies-gatsby-starter-default@0.1.0 build /opt/build/repo
2:06:55 PM: > gatsby-runner
2:06:55 PM: Building site with the Netlify Gatsby build runner.
2:06:59 PM: not finished compile gatsby files - 1.505s
2:06:59 PM: Gatsby exited with code 1
2:06:59 PM: npm ERR! code ELIFECYCLE
2:06:59 PM: npm ERR! errno 1
2:06:59 PM: npm ERR! annies-gatsby-starter-default@0.1.0 build: `gatsby-runner`
2:06:59 PM: npm ERR! Exit status 1
2:06:59 PM: npm ERR!
2:06:59 PM: npm ERR! Failed at the annies-gatsby-starter-default@0.1.0 build script.
2:06:59 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2:06:59 PM: npm ERR! A complete log of this run can be found in:
2:06:59 PM: npm ERR! /opt/buildhome/.npm/_logs/2022-07-01T12_06_59_928Z-debug.log
2:07:00 PM:
2:07:00 PM: ────────────────────────────────────────────────────────────────
2:07:00 PM: "build.command" failed
2:07:00 PM: ────────────────────────────────────────────────────────────────
2:07:00 PM:
2:07:00 PM: Error message
2:07:00 PM: Command failed with exit code 1: npm run build (https://ntl.fyi/exit-code-1)
2:07:00 PM:
2:07:00 PM: Error location
2:07:00 PM: In Build command from Netlify app:
2:07:00 PM: npm run build
2:07:00 PM:
2:07:00 PM: Resolved config
2:07:00 PM: build:
2:07:00 PM: command: npm run build
2:07:00 PM: commandOrigin: ui
2:07:00 PM: environment:
2:07:00 PM: - ALGOLIA_ADMIN_KEY
2:07:00 PM: - GATSBY_ALGOLIA_APP_ID
2:07:00 PM: - GATSBY_ALGOLIA_SEARCH_KEY
2:07:00 PM: - NODE_VERSION
2:07:00 PM: publish: /opt/build/repo/public
2:07:00 PM: publishOrigin: ui
2:07:00 PM: plugins:
2:07:00 PM: - inputs: {}
2:07:00 PM: origin: ui
2:07:00 PM: package: netlify-plugin-no-more-404
2:07:00 PM: - inputs: {}
2:07:00 PM: origin: ui
2:07:00 PM: package: '@netlify/plugin-gatsby'
2:07:00 PM: - inputs: {}
2:07:00 PM: origin: config
2:07:00 PM: package: '@netlify/gatsby-runner'
2:07:00 PM: Caching artifacts
2:07:00 PM: Started saving node modules
2:07:00 PM: Finished saving node modules
2:07:00 PM: Started saving build plugins
2:07:00 PM: Finished saving build plugins
2:07:00 PM: Started saving pip cache
2:07:00 PM: Finished saving pip cache
2:07:00 PM: Started saving emacs cask dependencies
2:07:00 PM: Finished saving emacs cask dependencies
2:07:00 PM: Started saving maven dependencies
2:07:00 PM: Finished saving maven dependencies
2:07:00 PM: Started saving boot dependencies
2:07:00 PM: Finished saving boot dependencies
2:07:00 PM: Started saving rust rustup cache
2:07:00 PM: Finished saving rust rustup cache
2:07:00 PM: Started saving go dependencies
2:07:01 PM: Finished saving go dependencies
2:07:03 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
2:07:03 PM: Creating deploy upload records
2:07:03 PM: Failing build: Failed to build site
2:07:03 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
2:07:03 PM: Finished processing build request in 14m7.391758322s
What caused this error and how do I fix it? Thanks!