Hi there,
I’m some issue deploying my site.
I’ve tried changing the build commands in my package.json to npm run build but I’m still getting the same error I do with gatsby build.
7:42:24 PM: Build ready to start
7:42:25 PM: build-image version: d84c79427e8f83c1ba17bcdd7b3fe38059376b68
7:42:25 PM: build-image tag: v3.6.1
7:42:25 PM: buildbot version: 44655717ddf0e7bd7f856f5b1154254de54b1d80
7:42:25 PM: Fetching cached dependencies
7:42:25 PM: Failed to fetch cache, continuing with build
7:42:25 PM: Starting to prepare the repo for build
7:42:26 PM: No cached dependencies found. Cloning fresh repo
7:42:26 PM: git clone [email protected]:samadjei/netlify-gatsby-portfolio
7:42:27 PM: Preparing Git Reference refs/heads/main
7:42:29 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'src/public ’ versus ‘public’ in the Netlify UI
7:42:29 PM: Different functions path detected, going to use the one specified in the Netlify configuration file: ‘src/y’ versus ‘y’ in the Netlify UI
7:42:29 PM: Different build command detected, going to use the one specified in the Netlify configuration file: 'gatsby build ’ versus ‘CI= npm run build’ in the Netlify UI
7:42:29 PM: Starting build script
7:42:29 PM: Installing dependencies
7:42:29 PM: Python version set to 2.7
7:42:30 PM: v12.18.0 is already installed.
7:42:31 PM: Now using node v12.18.0 (npm v6.14.4)
7:42:31 PM: Started restoring cached build plugins
7:42:31 PM: Finished restoring cached build plugins
7:42:31 PM: Attempting ruby version 2.7.1, read from environment
7:42:32 PM: Using ruby version 2.7.1
7:42:32 PM: Using PHP version 5.6
7:42:32 PM: Started restoring cached go cache
7:42:32 PM: Finished restoring cached go cache
7:42:32 PM: go version go1.14.4 linux/amd64
7:42:32 PM: go version go1.14.4 linux/amd64
7:42:32 PM: Installing missing commands
7:42:32 PM: Verify run directory
7:42:34 PM:
7:42:34 PM: ────────────────────────────────────────────────────────────────
7:42:34 PM: Netlify Build
7:42:34 PM: ────────────────────────────────────────────────────────────────
7:42:34 PM:
7:42:34 PM: ❯ Version
7:42:34 PM: @netlify/build 8.3.0
7:42:34 PM:
7:42:34 PM: ❯ Flags
7:42:34 PM: deployId: 60170820a99944000790125b
7:42:34 PM: mode: buildbot
7:42:34 PM:
7:42:34 PM: ❯ Current directory
7:42:34 PM: /opt/build/repo/src
7:42:34 PM:
7:42:34 PM: ❯ Config file
7:42:34 PM: /opt/build/repo/netlify.toml
7:42:34 PM:
7:42:34 PM: ❯ Context
7:42:34 PM: production
7:42:34 PM:
7:42:34 PM: ────────────────────────────────────────────────────────────────
7:42:34 PM: 1. build.command from netlify.toml
7:42:34 PM: ────────────────────────────────────────────────────────────────
7:42:34 PM:
7:42:34 PM: $ gatsby build
7:42:34 PM: bash: gatsby: command not found
7:42:34 PM:
7:42:34 PM: ────────────────────────────────────────────────────────────────
7:42:34 PM: “build.command” failed
7:42:34 PM: ────────────────────────────────────────────────────────────────
7:42:34 PM:
7:42:34 PM: Error message
7:42:34 PM: Command failed with exit code 127: gatsby build
7:42:34 PM:
7:42:34 PM: Error location
7:42:34 PM: In build.command from netlify.toml:
7:42:34 PM: gatsby build
7:42:34 PM:
7:42:34 PM: Resolved config
7:42:34 PM: build:
7:42:34 PM: base: /opt/build/repo/src
7:42:34 PM: command: 'gatsby build ’
7:42:34 PM: commandOrigin: config
7:42:34 PM: functions: /opt/build/repo/src/y
7:42:34 PM: publish: '/opt/build/repo/src/public ’
7:42:34 PM: Caching artifacts
7:42:34 PM: Started saving build plugins
7:42:34 PM: Finished saving build plugins
7:42:34 PM: Started saving pip cache
7:42:34 PM: Finished saving pip cache
7:42:34 PM: Started saving emacs cask dependencies
7:42:34 PM: Finished saving emacs cask dependencies
7:42:34 PM: Started saving maven dependencies
7:42:34 PM: Finished saving maven dependencies
7:42:34 PM: Started saving boot dependencies
7:42:34 PM: Finished saving boot dependencies
7:42:34 PM: Started saving rust rustup cache
7:42:34 PM: Finished saving rust rustup cache
7:42:34 PM: Started saving go dependencies
7:42:34 PM: Finished saving go dependencies
7:42:36 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
7:42:36 PM: Failing build: Failed to build site
7:42:36 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
7:42:36 PM: Finished processing build request in 11.194515505s
Here is the build script from my package.json
“scripts”: {
“build”: “npm run build”,
“develop”: “gatsby develop”,
“format”: “prettier --write "**/*.{js,jsx,ts,tsx,json,md}"”,
“start”: “npm run develop”,
“serve”: “gatsby serve”,
“clean”: “gatsby clean”,
“test”: “echo "Write tests! → Link not found - Rebrandly” && exit 1"
},
“repository”: {
“type”: “git”,
“url”: “GitHub - gatsbyjs/gatsby-starter-default: The default Gatsby starter”
},
“bugs”: {
“url”: “https://github.com/gatsbyjs/gatsby/issues”
}
My build settings