Not able to find `gatsby-source-contentful` plugin at build

Hi,

Was deploying the website from Github and I encounter the abovementioned error.

Here’s the logs from the build:
2:50:35 PM: Build ready to start
2:50:37 PM: build-image version: 53b83b6bede2920f236b25b6f5a95334320dc849
2:50:37 PM: build-image tag: v3.6.0
2:50:37 PM: buildbot version: 8ae026ef4905d9174e416775c6b64aa19950569b
2:50:37 PM: Building without cache
2:50:37 PM: Starting to prepare the repo for build
2:50:38 PM: No cached dependencies found. Cloning fresh repo
2:50:38 PM: git clone GitHub - derrickloo/my-react-app: This is for the React app tutorial by Meng To "React for Designers".
2:50:39 PM: Preparing Git Reference refs/heads/main
2:50:40 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: ‘public’ versus ‘public/’ in the Netlify UI
2:50:41 PM: Starting build script
2:50:41 PM: Installing dependencies
2:50:41 PM: Python version set to 2.7
2:50:42 PM: v12.18.0 is already installed.
2:50:43 PM: Now using node v12.18.0 (npm v6.14.4)
2:50:43 PM: Started restoring cached build plugins
2:50:43 PM: Finished restoring cached build plugins
2:50:44 PM: Attempting ruby version 2.7.1, read from environment
2:50:46 PM: Using ruby version 2.7.1
2:50:46 PM: Using PHP version 5.6
2:50:46 PM: Started restoring cached node modules
2:50:46 PM: Finished restoring cached node modules
2:50:46 PM: Installing NPM modules using NPM version 6.14.4
2:51:15 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:51:15 PM: > styled-components@3.3.3 postinstall /opt/build/repo/node_modules/styled-components
2:51:15 PM: > node ./scripts/postinstall.js || exit 0
2:51:16 PM: Use styled-components at work? Consider supporting our development efforts at styled-components - Open Collective
2:51:17 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
2:51:17 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
2:51:17 PM: added 1425 packages from 883 contributors and audited 1542 packages in 30s
2:51:19 PM: 3 packages are looking for funding
2:51:19 PM: run npm fund for details
2:51:19 PM: found 1758 vulnerabilities (670 low, 35 moderate, 1049 high, 4 critical)
2:51:19 PM: run npm audit fix to fix them, or npm audit for details
2:51:19 PM: NPM modules installed
2:51:19 PM: Started restoring cached go cache
2:51:19 PM: Finished restoring cached go cache
2:51:19 PM: go version go1.14.4 linux/amd64
2:51:19 PM: go version go1.14.4 linux/amd64
2:51:19 PM: Installing missing commands
2:51:19 PM: Verify run directory
2:51:21 PM: ​
2:51:21 PM: ────────────────────────────────────────────────────────────────
2:51:21 PM: Netlify Build
2:51:21 PM: ────────────────────────────────────────────────────────────────
2:51:21 PM: ​
2:51:21 PM: ❯ Version
2:51:21 PM: @netlify/build 8.0.0
2:51:21 PM: ​
2:51:21 PM: ❯ Flags
2:51:21 PM: deployId: 5fe1973badab3791f065b71d
2:51:21 PM: mode: buildbot
2:51:21 PM: ​
2:51:21 PM: ❯ Current directory
2:51:21 PM: /opt/build/repo
2:51:21 PM: ​
2:51:21 PM: ❯ Config file
2:51:21 PM: No config file was defined: using default values.
2:51:21 PM: ​
2:51:21 PM: ❯ Context
2:51:21 PM: production
2:51:21 PM: ​
2:51:21 PM: ────────────────────────────────────────────────────────────────
2:51:21 PM: 1. Build command from Netlify app
2:51:21 PM: ────────────────────────────────────────────────────────────────
2:51:21 PM: ​
2:51:21 PM: $ CI= npm run build
2:51:21 PM: > gatsby-starter-default@1.0.0 build /opt/build/repo
2:51:21 PM: > gatsby build
2:51:23 PM: success delete html and css files from previous builds — 0.008 s
2:51:23 PM: success open and validate gatsby-config.js — 0.015 s
2:51:23 PM: error Unable to find plugin “gatsby-source-contentful”
2:51:23 PM:
2:51:23 PM: Error: Unable to find plugin “gatsby-source-contentful”
2:51:23 PM:
2:51:23 PM: - load.js:89 resolvePlugin
2:51:23 PM: [repo]/[gatsby]/dist/bootstrap/load-plugins/load.js:89:11
2:51:23 PM:
2:51:23 PM: - load.js:138 processPlugin
2:51:23 PM: [repo]/[gatsby]/dist/bootstrap/load-plugins/load.js:138:27
2:51:23 PM:
2:51:23 PM: - load.js:159
2:51:23 PM: [repo]/[gatsby]/dist/bootstrap/load-plugins/load.js:159:28
2:51:23 PM:
2:51:23 PM: - Array.forEach
2:51:23 PM:
2:51:23 PM: - load.js:158 _callee$
2:51:23 PM: [repo]/[gatsby]/dist/bootstrap/load-plugins/load.js:158:28
2:51:23 PM:
2:51:23 PM: - index.js:61 _callee$
2:51:23 PM: [repo]/[gatsby]/dist/bootstrap/load-plugins/index.js:61:18
2:51:23 PM:
2:51:23 PM:
2:51:23 PM: npm ERR! code ELIFECYCLE
2:51:23 PM: npm ERR! errno 1
2:51:23 PM: npm ERR! gatsby-starter-default@1.0.0 build: gatsby build
2:51:23 PM: npm ERR! Exit status 1
2:51:23 PM: npm ERR!
2:51:23 PM: npm ERR! Failed at the gatsby-starter-default@1.0.0 build script.
2:51:23 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2:51:23 PM: npm ERR! A complete log of this run can be found in:
2:51:23 PM: npm ERR! /opt/buildhome/.npm/_logs/2020-12-22T06_51_23_611Z-debug.log
2:51:23 PM: ​
2:51:23 PM: ────────────────────────────────────────────────────────────────
2:51:23 PM: “build.command” failed
2:51:23 PM: ────────────────────────────────────────────────────────────────
2:51:23 PM: ​
2:51:23 PM: Error message
2:51:23 PM: Command failed with exit code 1: CI= npm run build
2:51:23 PM: ​
2:51:23 PM: Error location
2:51:23 PM: In Build command from Netlify app:
2:51:23 PM: CI= npm run build
2:51:23 PM: ​
2:51:23 PM: Resolved config
2:51:23 PM: build:
2:51:23 PM: command: CI= npm run build
2:51:23 PM: commandOrigin: ui
2:51:23 PM: environment:
2:51:23 PM: - CONTENTFUL_ACCESS_TOKEN
2:51:23 PM: - CONTENTFUL_SPACE_ID
2:51:23 PM: publish: /opt/build/repo/public
2:51:23 PM: Caching artifacts
2:51:23 PM: Started saving node modules
2:51:23 PM: Finished saving node modules
2:51:23 PM: Started saving build plugins
2:51:23 PM: Finished saving build plugins
2:51:23 PM: Started saving pip cache
2:51:23 PM: Finished saving pip cache
2:51:23 PM: Started saving emacs cask dependencies
2:51:23 PM: Finished saving emacs cask dependencies
2:51:23 PM: Started saving maven dependencies
2:51:23 PM: Finished saving maven dependencies
2:51:23 PM: Started saving boot dependencies
2:51:24 PM: Finished saving boot dependencies
2:51:24 PM: Started saving rust rustup cache
2:51:24 PM: Finished saving rust rustup cache
2:51:24 PM: Started saving rust cargo bin cache
2:51:24 PM: Finished saving rust cargo bin cache
2:51:24 PM: Started saving go dependencies
2:51:24 PM: Finished saving go dependencies
2:51:27 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
2:51:27 PM: Failing build: Failed to build site
2:51:27 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
2:51:27 PM: Finished processing build request in 49.582201809s

I’ve tried searching on the internet but can’t really find a solution thus far.

Please assist and thank you for your time.

Hiya, sorry you are having trouble with your build.

This Support Guide contains a ton of useful debugging tips that can likely help you solve your problem :slight_smile:

We also recommend trying to search the forums with the build error you encountered - it’s likely your question was already asked by someone else!

If you are still having problems, please provide as much information as you can on what you have already tried, what your build settings are, your package.json, etc. Thanks!