mathieudutour / medium-to-own-blog

Switch from Medium to your own blog in a few minutes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Netlify build fails with: Error running command: Build script returned non-zero exit code: 1

johnpcutler opened this issue Β· comments

Repo
https://github.com/johnpcutler/cutlefish

Describe the bug
Netlify deploy is failing with the following errors:

2:31:31 PM: Build ready to start
2:31:33 PM: build-image version: 9e0f207a27642d0115b1ca97cd5e8cebbe492f63
2:31:33 PM: build-image tag: v3.3.2
2:31:33 PM: buildbot version: ef8d0929ed0baabafd8bbb7d0b021e1fc24180c0
2:31:33 PM: Fetching cached dependencies
2:31:34 PM: Starting to download cache of 255.0KB
2:31:34 PM: Finished downloading cache in 167.42864ms
2:31:34 PM: Starting to extract cache
2:31:34 PM: Failed to fetch cache, continuing with build
2:31:34 PM: Starting to prepare the repo for build
2:31:34 PM: No cached dependencies found. Cloning fresh repo
2:31:34 PM: git clone https://github.com/johnpcutler/cutlefish
2:31:37 PM: Preparing Git Reference refs/heads/master
2:31:37 PM: Found netlify.toml. Overriding site configuration
2:31:37 PM: Starting build script
2:31:37 PM: Installing dependencies
2:31:39 PM: Downloading and installing node v10.16.0...
2:31:39 PM: Downloading https://nodejs.org/dist/v10.16.0/node-v10.16.0-linux-x64.tar.xz...
2:31:39 PM: 
#################
2:31:39 PM:    23.6%
2:31:39 PM: 
#####################################################
2:31:39 PM: ################### 100.0%
2:31:40 PM: Computing checksum with sha256sum
2:31:40 PM: Checksums matched!
2:31:42 PM: Now using node v10.16.0 (npm v6.9.0)
2:31:42 PM: Attempting ruby version 2.6.2, read from environment
2:31:44 PM: Using ruby version 2.6.2
2:31:44 PM: Using PHP version 5.6
2:31:44 PM: Started restoring cached node modules
2:31:44 PM: Finished restoring cached node modules
2:31:44 PM: Installing NPM modules using NPM version 6.9.0
2:31:47 PM: npm WARN deprecated @babel/polyfill@7.4.4: 🚨 As of Babel 7.4.0, this
2:31:47 PM: npm
2:31:47 PM: WARN deprecated package has been deprecated in favor of directly
2:31:47 PM: npm WARN deprecated including core-js/stable (to polyfill ECMAScript
2:31:47 PM: npm WARN deprecated features) and regenerator-runtime/runtime
2:31:47 PM: npm WARN
2:31:47 PM:  deprecated (needed to use transpiled generator functions):
2:31:47 PM: npm WARN deprecated
2:31:47 PM: npm WARN deprecated
2:31:47 PM:    > import "core-js/stable";
2:31:47 PM: npm WARN deprecated   > import "regenerator-runtime/runtime";
2:31:57 PM: npm WARN deprecated joi@11.4.0: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
2:32:00 PM: npm WARN deprecated
2:32:00 PM:  hoek@4.2.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
2:32:00 PM: npm WARN deprecated topo@2.0.2: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
2:32:01 PM: npm WARN
2:32:01 PM: deprecated core-js@1.2.7: core-js@<2.6.8 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2.
2:32:37 PM: > sharp@0.22.1 install /opt/build/repo/node_modules/sharp
2:32:37 PM: > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
2:32:38 PM: info
2:32:38 PM: sharp
2:32:38 PM:  Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.7.4/libvips-8.7.4-linux-x64.tar.gz
2:32:40 PM: > pre-commit@1.2.2 install /opt/build/repo/node_modules/pre-commit
2:32:40 PM: > node install.js
2:32:40 PM: > core-js@2.6.9 postinstall /opt/build/repo/node_modules/core-js
2:32:40 PM: > node scripts/postinstall || echo "ignore"
2:32:40 PM: Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
2:32:40 PM: The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
2:32:40 PM: > https://opencollective.com/core-js 
2:32:40 PM: > https://www.patreon.com/zloirock 
2:32:40 PM: Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
2:32:40 PM: > core-js-pure@3.1.4 postinstall /opt/build/repo/node_modules/core-js-pure
2:32:40 PM: > node scripts/postinstall || echo "ignore"
2:32:40 PM: Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
2:32:40 PM: The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
2:32:40 PM: > https://opencollective.com/core-js 
2:32:40 PM: > https://www.patreon.com/zloirock 
2:32:40 PM: Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
2:32:41 PM: > spawn-sync@1.0.15 postinstall /opt/build/repo/node_modules/spawn-sync
2:32:41 PM: > node postinstall
2:32:41 PM: > gatsby-telemetry@1.1.6 postinstall /opt/build/repo/node_modules/gatsby-telemetry
2:32:41 PM: > node src/postinstall.js
2:32:41 PM: > cwebp-bin@5.1.0 postinstall /opt/build/repo/node_modules/cwebp-bin
2:32:41 PM: > node lib/install.js
2:32:41 PM:   βœ” cwebp pre-build test passed successfully
2:32:42 PM: > mozjpeg@6.0.1 postinstall /opt/build/repo/node_modules/mozjpeg
2:32:42 PM: > node lib/install.js
2:32:42 PM:   βœ” mozjpeg pre-build test passed successfully
2:32:42 PM: > pngquant-bin@5.0.2 postinstall /opt/build/repo/node_modules/pngquant-bin
2:32:42 PM: > node lib/install.js
2:32:43 PM:   βœ” pngquant pre-build test passed successfully
2:32:44 PM: npm
2:32:44 PM: notice created a lockfile as package-lock.json. You should commit this file.
2:32:44 PM: npm WARN
2:32:44 PM:  eslint-config-react-app@3.0.8 requires a peer of babel-eslint@9.x but none is installed. You must install peer dependencies yourself.
2:32:44 PM: npm WARN
2:32:44 PM:  ts-pnp@1.1.2 requires a peer of typescript@* but none is installed. You must install peer dependencies yourself.
2:32:44 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
2:32:44 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
2:32:44 PM: added 2082 packages from 1129 contributors and audited 32907 packages in 59.409s
2:32:44 PM: found 0 vulnerabilities
2:32:44 PM: NPM modules installed
2:32:45 PM: Started restoring cached go cache
2:32:45 PM: Finished restoring cached go cache
2:32:45 PM: unset GOOS;
2:32:45 PM: unset GOARCH;
2:32:45 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.12.linux.amd64';
2:32:45 PM: export PATH="/opt/buildhome/.gimme/versions/go1.12.linux.amd64/bin:${PATH}";
2:32:45 PM: go version >&2;
2:32:45 PM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.12.linux.amd64.env';
2:32:45 PM: go version go1.12 linux/amd64
2:32:45 PM: Installing missing commands
2:32:45 PM: Verify run directory
2:32:45 PM: Executing user command: gatsby build
2:32:47 PM: success open and validate gatsby-configs β€” 0.069
2:32:47 PM: error Cannot find module 'change-case'
2:32:47 PM: Error in "/opt/build/repo/node_modules/gatsby-mdx/gatsby-node.js": Cannot find module 'change-case'
2:32:47 PM: See our docs page for more info on this error: https://gatsby.dev/issue-how-to
2:32:47 PM: 
2:32:47 PM:   Error: Cannot find module 'change-case'
2:32:47 PM:   
2:32:47 PM:   - loader.js:636 Function.Module._resolveFilename
2:32:47 PM:     internal/modules/cjs/loader.js:636:15
2:32:47 PM:   
2:32:47 PM:   - loader.js:562 Function.Module._load
2:32:47 PM:     internal/modules/cjs/loader.js:562:25
2:32:47 PM:   
2:32:47 PM:   - loader.js:690 Module.require
2:32:47 PM:     internal/modules/cjs/loader.js:690:17
2:32:47 PM:   
2:32:47 PM:   - v8-compile-cache.js:159 require
2:32:47 PM:     [repo]/[v8-compile-cache]/v8-compile-cache.js:159:20
2:32:47 PM:   
2:32:47 PM:   - babel-plugin-html-attr-to-jsx-attr.js:1 Object.<anonymous>
2:32:47 PM:     [repo]/[gatsby-mdx]/utils/babel-plugin-html-attr-to-jsx-attr.js:1:85
2:32:47 PM:   
2:32:47 PM:   - v8-compile-cache.js:178 Module._compile
2:32:47 PM:     [repo]/[v8-compile-cache]/v8-compile-cache.js:178:30
2:32:47 PM:   
2:32:47 PM:   - loader.js:787 Object.Module._extensions..js
2:32:47 PM:     internal/modules/cjs/loader.js:787:10
2:32:47 PM:   
2:32:47 PM:   - loader.js:653 Module.load
2:32:47 PM:     internal/modules/cjs/loader.js:653:32
2:32:47 PM:   
2:32:47 PM:   - loader.js:593 tryModuleLoad
2:32:47 PM:     internal/modules/cjs/loader.js:593:12
2:32:47 PM:   
2:32:47 PM:   - loader.js:585 Function.Module._load
2:32:47 PM:     internal/modules/cjs/loader.js:585:3
2:32:47 PM:   
2:32:47 PM:   - loader.js:690 Module.require
2:32:47 PM:     internal/modules/cjs/loader.js:690:17
2:32:47 PM:   
2:32:47 PM:   - v8-compile-cache.js:159 require
2:32:47 PM:     [repo]/[v8-compile-cache]/v8-compile-cache.js:159:20
2:32:47 PM:   
2:32:47 PM:   - gen-mdx.js:9 Object.<anonymous>
2:32:47 PM:     [repo]/[gatsby-mdx]/utils/gen-mdx.js:9:27
2:32:47 PM:   
2:32:47 PM:   - v8-compile-cache.js:178 Module._compile
2:32:47 PM:     [repo]/[v8-compile-cache]/v8-compile-cache.js:178:30
2:32:47 PM:   
2:32:47 PM:   - loader.js:787 Object.Module._extensions..js
2:32:47 PM:     internal/modules/cjs/loader.js:787:10
2:32:47 PM:   
2:32:47 PM:   - loader.js:653 Module.load
2:32:47 PM:     internal/modules/cjs/loader.js:653:32
2:32:47 PM:   
2:32:47 PM: 
2:32:47 PM: Skipping functions preparation step: no functions directory set
2:32:47 PM: Caching artifacts
2:32:47 PM: Started saving node modules
2:32:47 PM: Finished saving node modules
2:32:47 PM: Started saving pip cache
2:32:47 PM: Finished saving pip cache
2:32:47 PM: Started saving emacs cask dependencies
2:32:47 PM: Finished saving emacs cask dependencies
2:32:47 PM: Started saving maven dependencies
2:32:47 PM: Finished saving maven dependencies
2:32:47 PM: Started saving boot dependencies
2:32:48 PM: Finished saving boot dependencies
2:32:48 PM: Started saving go dependencies
2:32:48 PM: Finished saving go dependencies
2:32:50 PM: Error running command: Build script returned non-zero exit code: 1
2:32:50 PM: Failing build: Failed to build site
2:32:50 PM: failed during stage 'building site': Build script returned non-zero exit code: 1
2:32:50 PM: Finished processing build request in 1m16.84519123s```

I installed https://www.npmjs.com/package/change-case and this lets me get something deployed locally. I'm not really sure where I'd specify that dependency. Would that be in package.json ?

Ah yes, it seems that some versions of gatsby-mdx are missing the change-case dependency: https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-mdx/CHANGELOG.md#1011-2019-07-11

The fix would be to run npm install -S gatsby-plugin-mdx@1.0.17