Site Deploy failed due to an error in @netlify/plugin-gatsby plugin

My site WVICL (westvirginiamtb.org) has recently started failing to build.

I don’t have this plugin installed or pinned.

10:20:40 AM: Plugin “@netlify/plugin-gatsby” internal error
10:20:40 AM: ​
10:20:40 AM: Error message
10:20:40 AM: CpyError: Cannot copy from .cache/adapters/node_modules/.bin/download-msgpackr-prebuilds to /opt/build/cache/cwd/.cache/adapters/node_modules/.bin/download-msgpackr-prebuilds: EISDIR: illegal operation on a directory ‘/opt/build/repo/.cache/adapters/node_modules/.bin/download-msgpackr-prebuilds’
10:20:40 AM: ​
10:20:40 AM: Plugin details
10:20:40 AM: Package: @netlify/plugin-gatsby
10:20:40 AM: Version: 1.0.3
10:20:40 AM: Repository: git+https://github.com/netlify/netlify-plugin-gatsby.git
10:20:40 AM: npm link: @netlify/plugin-gatsby - npm
10:20:40 AM: Report issues: GitHub · Where software is built
10:20:40 AM: ​
10:20:40 AM: Error location
10:20:40 AM: In “onPostBuild” event in “@netlify/plugin-gatsby” from Netlify app
10:20:40 AM: at pMap.concurrency.concurrency (file:///opt/buildhome/node-deps/node_modules/cpy/index.js:261:12)
10:20:40 AM: at async file:///opt/buildhome/node-deps/node_modules/p-map/index.js:121:20
10:20:40 AM: ​
10:20:40 AM: Error properties
10:20:40 AM: {
10:20:40 AM: errno: -21,
10:20:40 AM: code: ‘EISDIR’,
10:20:40 AM: source: ‘/opt/build/repo/.cache/adapters/node_modules/.bin/download-msgpackr-prebuilds’
10:20:40 AM: }

Here is the full build log.

10:17:11 AM: build-image version: 235a96ed6c11cbdf942eed7e70e6802956f9b464 (focal)
10:17:11 AM: buildbot version: 5276eccdd060881dae1f6d00b54ef962dbbaa654
10:17:11 AM: Fetching cached dependencies
10:17:11 AM: Failed to fetch cache, continuing with build
10:17:11 AM: Starting to prepare the repo for build
10:17:11 AM: No cached dependencies found. Cloning fresh repo
10:17:11 AM: git clone --filter=blob:none https://github.com/edcurtis/WVICL
10:17:12 AM: Preparing Git Reference refs/heads/master
10:17:26 AM: Starting to install dependencies
10:17:27 AM: mise python@3.13.5   install
10:17:27 AM: mise python@3.13.5   download cpython-3.13.5+20250702-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz
10:17:27 AM: mise python@3.13.5   extract cpython-3.13.5+20250702-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz
10:17:27 AM: mise python@3.13.5   python --version
10:17:27 AM: mise python@3.13.5   Python 3.13.5
10:17:27 AM: mise python@3.13.5 ✓ installed
10:17:27 AM: Python version set to 3.13
10:17:29 AM: Collecting pipenv
10:17:29 AM:   Downloading pipenv-2025.0.3-py3-none-any.whl.metadata (17 kB)
10:17:29 AM: Collecting certifi (from pipenv)
10:17:29 AM:   Downloading certifi-2025.6.15-py3-none-any.whl.metadata (2.4 kB)
10:17:29 AM: Collecting packaging>=22 (from pipenv)
10:17:29 AM:   Downloading packaging-25.0-py3-none-any.whl.metadata (3.3 kB)
10:17:29 AM: Collecting setuptools>=67 (from pipenv)
10:17:29 AM:   Downloading setuptools-80.9.0-py3-none-any.whl.metadata (6.6 kB)
10:17:29 AM: Collecting virtualenv>=20.24.2 (from pipenv)
10:17:29 AM:   Downloading virtualenv-20.31.2-py3-none-any.whl.metadata (4.5 kB)
10:17:29 AM: Collecting distlib<1,>=0.3.7 (from virtualenv>=20.24.2->pipenv)
10:17:29 AM:   Downloading distlib-0.3.9-py2.py3-none-any.whl.metadata (5.2 kB)
10:17:29 AM: Collecting filelock<4,>=3.12.2 (from virtualenv>=20.24.2->pipenv)
10:17:29 AM:   Downloading filelock-3.18.0-py3-none-any.whl.metadata (2.9 kB)
10:17:29 AM: Collecting platformdirs<5,>=3.9.1 (from virtualenv>=20.24.2->pipenv)
10:17:29 AM:   Downloading platformdirs-4.3.8-py3-none-any.whl.metadata (12 kB)
10:17:29 AM: Downloading pipenv-2025.0.3-py3-none-any.whl (2.9 MB)
10:17:29 AM:    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.9/2.9 MB 56.3 MB/s eta 0:00:00
10:17:29 AM: Downloading packaging-25.0-py3-none-any.whl (66 kB)
10:17:29 AM: Downloading setuptools-80.9.0-py3-none-any.whl (1.2 MB)
10:17:29 AM:    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 61.5 MB/s eta 0:00:00
10:17:30 AM: Downloading virtualenv-20.31.2-py3-none-any.whl (6.1 MB)
10:17:30 AM:    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.1/6.1 MB 174.6 MB/s eta 0:00:00
10:17:30 AM: Downloading certifi-2025.6.15-py3-none-any.whl (157 kB)
10:17:30 AM: Downloading distlib-0.3.9-py2.py3-none-any.whl (468 kB)
10:17:30 AM: Downloading filelock-3.18.0-py3-none-any.whl (16 kB)
10:17:30 AM: Downloading platformdirs-4.3.8-py3-none-any.whl (18 kB)
10:17:30 AM: Installing collected packages: distlib, setuptools, platformdirs, packaging, filelock, certifi, virtualenv, pipenv
10:17:32 AM: Successfully installed certifi-2025.6.15 distlib-0.3.9 filelock-3.18.0 packaging-25.0 pipenv-2025.0.3 platformdirs-4.3.8 setuptools-80.9.0 virtualenv-20.31.2
10:17:32 AM: [notice] A new release of pip is available: 24.3.1 -> 25.1.1
10:17:32 AM: [notice] To update, run: pip install --upgrade pip
10:17:32 AM: Attempting Ruby version 2.7.2, read from environment
10:17:33 AM: Using Ruby version 2.7.2
10:17:34 AM: Started restoring cached go cache
10:17:34 AM: Finished restoring cached go cache
10:17:34 AM: go version go1.19.13 linux/amd64
10:17:34 AM: Using PHP version 8.0
10:17:35 AM: Downloading and installing node v18.18.2...
10:17:35 AM: Downloading https://nodejs.org/dist/v18.18.2/node-v18.18.2-linux-x64.tar.xz...
10:17:36 AM: Computing checksum with sha256sum
10:17:36 AM: Checksums matched!
10:17:38 AM: Now using node v18.18.2 (npm v9.8.1)
10:17:38 AM: Enabling Node.js Corepack
10:17:38 AM: Started restoring cached build plugins
10:17:38 AM: Finished restoring cached build plugins
10:17:38 AM: Started restoring cached corepack dependencies
10:17:38 AM: Finished restoring cached corepack dependencies
10:17:38 AM: No npm workspaces detected
10:17:38 AM: Started restoring cached node modules
10:17:38 AM: Finished restoring cached node modules
10:17:38 AM: Installing npm packages using npm version 9.8.1
10:17:40 AM: npm WARN ERESOLVE overriding peer dependency
10:17:40 AM: npm WARN While resolving: react-server-dom-webpack@0.0.0-experimental-c8b778b7f-20220825
10:17:40 AM: npm WARN Found: react@18.3.1
10:17:40 AM: npm WARN node_modules/react
10:17:40 AM: npm WARN   react@"^18.0.0" from the root project
10:17:40 AM: npm WARN   17 more (@gatsbyjs/reach-router, gatsby, gatsby-link, ...)
10:17:40 AM: npm WARN
10:17:40 AM: npm WARN Could not resolve dependency:
10:17:40 AM: npm WARN peer react@"0.0.0-experimental-c8b778b7f-20220825" from react-server-dom-webpack@0.0.0-experimental-c8b778b7f-20220825
10:17:40 AM: npm WARN node_modules/react-server-dom-webpack
10:17:40 AM: npm WARN   react-server-dom-webpack@"0.0.0-experimental-c8b778b7f-20220825" from gatsby@5.14.5
10:17:40 AM: npm WARN   node_modules/gatsby
10:17:40 AM: npm WARN
10:17:40 AM: npm WARN Conflicting peer dependency: react@0.0.0-experimental-c8b778b7f-20220825
10:17:40 AM: npm WARN node_modules/react
10:17:40 AM: npm WARN   peer react@"0.0.0-experimental-c8b778b7f-20220825" from react-server-dom-webpack@0.0.0-experimental-c8b778b7f-20220825
10:17:40 AM: npm WARN   node_modules/react-server-dom-webpack
10:17:40 AM: npm WARN     react-server-dom-webpack@"0.0.0-experimental-c8b778b7f-20220825" from gatsby@5.14.5
10:17:40 AM: npm WARN     node_modules/gatsby
10:17:42 AM: npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
10:17:42 AM: npm WARN deprecated string-similarity@1.2.2: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
10:17:42 AM: npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
10:17:42 AM: npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
10:17:42 AM: npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
10:17:43 AM: npm WARN deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
10:17:43 AM: npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
10:17:43 AM: npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
10:17:44 AM: npm WARN deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
10:17:44 AM: npm WARN deprecated har-validator@5.1.5: this library is no longer supported
10:17:44 AM: npm WARN deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
10:17:45 AM: npm WARN deprecated sudo-prompt@8.2.5: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
10:17:46 AM: npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
10:17:47 AM: npm WARN deprecated @humanwhocodes/config-array@0.5.0: Use @eslint/config-array instead
10:17:47 AM: npm WARN deprecated @humanwhocodes/object-schema@1.2.1: Use @eslint/object-schema instead
10:17:48 AM: npm WARN deprecated @babel/plugin-proposal-optional-chaining@7.21.0: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
10:17:48 AM: npm WARN deprecated @babel/plugin-proposal-nullish-coalescing-operator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
10:17:48 AM: npm WARN deprecated @babel/plugin-proposal-numeric-separator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.
10:17:48 AM: npm WARN deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
10:17:48 AM: npm WARN deprecated @babel/plugin-proposal-object-rest-spread@7.20.7: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.
10:17:49 AM: npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
10:17:49 AM: npm WARN deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
10:17:49 AM: npm WARN deprecated phin@2.9.3: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
10:17:49 AM: npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
10:17:53 AM: npm WARN deprecated eslint@7.32.0: This version is no longer supported. Please see https://eslint.org/version-support for other options.
10:18:58 AM: added 1716 packages, and audited 1717 packages in 1m
10:18:58 AM: 316 packages are looking for funding
10:18:58 AM:   run `npm fund` for details
10:18:59 AM: 48 vulnerabilities (18 low, 22 moderate, 5 high, 3 critical)
10:18:59 AM: To address issues that do not require attention, run:
10:18:59 AM:   npm audit fix
10:18:59 AM: To address all issues (including breaking changes), run:
10:18:59 AM:   npm audit fix --force
10:18:59 AM: Run `npm audit` for details.
10:18:59 AM: npm packages installed
10:18:59 AM: Successfully installed dependencies
10:18:59 AM: Starting build script
10:19:01 AM: Detected 1 framework(s)
10:19:01 AM: "gatsby" at version "5.14.5"
10:19:01 AM: Section completed: initializing
10:19:03 AM: ​
10:19:03 AM: Netlify Build                                                 
10:19:03 AM: ────────────────────────────────────────────────────────────────
10:19:03 AM: ​
10:19:03 AM: ❯ Version
10:19:03 AM:   @netlify/build 33.4.6
10:19:03 AM: ​
10:19:03 AM: ❯ Flags
10:19:03 AM:   accountId: 5c753a1e9379af017f333865
10:19:03 AM:   baseRelDir: true
10:19:03 AM:   buildId: 686933e6b7da9600080c2675
10:19:03 AM:   deployId: 686933e6b7da9600080c2677
10:19:03 AM: ​
10:19:03 AM: ❯ Current directory
10:19:03 AM:   /opt/build/repo
10:19:03 AM: ​
10:19:03 AM: ❯ Config file
10:19:03 AM:   No config file was defined: using default values.
10:19:03 AM: ​
10:19:03 AM: ❯ Context
10:19:03 AM:   production
10:19:03 AM: ​
10:19:03 AM: ❯ Installing plugins
10:19:03 AM:    - @netlify/plugin-gatsby@1
10:19:07 AM: ​
10:19:07 AM: ❯ Loading plugins
10:19:07 AM:    - @netlify/plugin-gatsby@1.0.3 from Netlify app
10:19:07 AM: ​
10:19:07 AM: ❯ Outdated plugins
10:19:07 AM:    - @netlify/plugin-gatsby@1.0.3: latest version is 3.8.4
10:19:07 AM:      Migration guide: https://ntl.fyi/gatsby-plugin-migration
10:19:07 AM:      To upgrade this plugin, please uninstall and re-install it from the Netlify plugins directory (https://app.netlify.com/plugins)
10:19:09 AM: No Gatsby cache found. Building fresh.
10:19:09 AM: Add `gatsby-plugin-netlify` to `gatsby-config.js` if you would like to support Gatsby redirects. 🎉
10:19:09 AM: ​
10:19:09 AM: Build command from Netlify app                                
10:19:09 AM: ────────────────────────────────────────────────────────────────
10:19:09 AM: ​
10:19:09 AM: $ gatsby build
10:19:15 AM: success compile gatsby files - 3.589s
10:19:15 AM: success load gatsby config - 0.043s
10:19:20 AM: success Installing Netlify adapter (gatsby-adapter-netlify@^1.0.4) - 4.841s
10:19:20 AM: info If you plan on staying on this deployment platform, consider installing "gatsby-adapter-netlify@^1.0.4" as a dependency in your project. This will give you faster and more robust installs.
10:19:20 AM: info Using gatsby-adapter-netlify adapter
10:19:21 AM: success load plugins - 1.429s
10:19:21 AM: warning gatsby-plugin-react-helmet: Gatsby now has built-in support for modifying the document head. Learn more at https://gatsby.dev/gatsby-head
10:19:21 AM: success onPreInit - 0.008s
10:19:21 AM: success initialize cache - 0.053s
10:19:21 AM: success copy gatsby files - 0.097s
10:19:22 AM: success Compiling Gatsby Functions - 0.422s
10:19:22 AM: success onPreBootstrap - 0.441s
10:19:23 AM: success createSchemaCustomization - 0.006s
10:19:28 AM: success Checking for changed pages - 0.000s
10:19:28 AM: success source and transform nodes - 5.295s
10:19:28 AM: info Writing GraphQL type definitions to /opt/build/repo/.cache/schema.gql
10:19:28 AM: success building schema - 0.597s
10:19:28 AM: success createPages - 0.020s
10:19:29 AM: success createPagesStatefully - 0.604s
10:19:29 AM: info Total nodes: 827, SitePage nodes: 66 (use --verbose for breakdown)
10:19:29 AM: success Checking for changed pages - 0.000s
10:19:29 AM: success onPreExtractQueries - 0.000s
10:19:35 AM: success extract queries from components - 5.775s
10:19:35 AM: success write out redirect data - 0.002s
10:19:37 AM: success Build manifest and related icons - 1.908s
10:19:37 AM: success onPostBootstrap - 1.910s
10:19:37 AM: info bootstrap finished - 27.906s
10:19:37 AM: success write out requires - 0.088s
10:20:01 AM: success Building production JavaScript and CSS bundles - 24.256s
10:20:16 AM: success Building HTML renderer - 14.376s
10:20:16 AM: success Execute page configs - 0.124s
10:20:16 AM: success Caching Webpack compilations - 0.000s
10:20:16 AM: warning [gatsby-transformer-sharp] The "fixed" and "fluid" resolvers are now deprecated. Switch to "gatsby-plugin-image" for better performance and a simpler API. See https://gatsby.dev/migrate-images to learn how.
10:20:33 AM: success Building static HTML for pages - 6.382s - 66/66 10.34/s
10:20:33 AM: info There are no new or changed slice html files to build.
10:20:33 AM: success stitching slices - 0.116s
10:20:33 AM: success onPostBuild - 0.205s
10:20:33 AM:   10:20:38 AM: ​
10:20:38 AM: Packaging Functions from netlify/functions directory:
10:20:38 AM:  - gatsby/gatsby.js
10:20:38 AM: ​
10:20:39 AM: ​
10:20:39 AM: (Functions bundling completed in 793ms)
10:20:40 AM: Failed during stage 'building site': Build script returned non-zero exit code: 4 (https://ntl.fyi/exit-code-4)
10:20:40 AM: ​
10:20:40 AM: Plugin "@netlify/plugin-gatsby" internal error                
10:20:40 AM: ────────────────────────────────────────────────────────────────
10:20:40 AM: ​
10:20:40 AM:   Error message
10:20:40 AM:   CpyError: Cannot copy from `.cache/adapters/node_modules/.bin/download-msgpackr-prebuilds` to `/opt/build/cache/cwd/.cache/adapters/node_modules/.bin/download-msgpackr-prebuilds`: EISDIR: illegal operation on a directory '/opt/build/repo/.cache/adapters/node_modules/.bin/download-msgpackr-prebuilds'
10:20:40 AM: ​
10:20:40 AM:   Plugin details
10:20:40 AM:   Package:        @netlify/plugin-gatsby
10:20:40 AM:   Version:        1.0.3
10:20:40 AM:   Repository:     git+https://github.com/netlify/netlify-plugin-gatsby.git
10:20:40 AM:   npm link:       https://www.npmjs.com/package/@netlify/plugin-gatsby
10:20:40 AM:   Report issues:  https://github.com/netlify/netlify-plugin-gatsby/issues
10:20:40 AM: ​
10:20:40 AM:   Error location
10:20:40 AM:   In "onPostBuild" event in "@netlify/plugin-gatsby" from Netlify app
10:20:40 AM:       at pMap.concurrency.concurrency (file:///opt/buildhome/node-deps/node_modules/cpy/index.js:261:12)
10:20:40 AM:       at async file:///opt/buildhome/node-deps/node_modules/p-map/index.js:121:20
10:20:40 AM: ​
10:20:40 AM:   Error properties
10:20:40 AM:   {
10:20:40 AM:     errno: -21,
10:20:40 AM:     code: 'EISDIR',
10:20:40 AM:     source: '/opt/build/repo/.cache/adapters/node_modules/.bin/download-msgpackr-prebuilds'
10:20:40 AM:   }
10:20:40 AM: ​
10:20:40 AM:   Resolved config
10:20:40 AM:   build:
10:20:40 AM:     command: gatsby build
10:20:40 AM:     commandOrigin: ui
10:20:40 AM:     environment:
10:20:40 AM:       - NODE_VERSION
10:20:40 AM:     publish: /opt/build/repo/public
10:20:40 AM:     publishOrigin: ui
    - inputs: {}
      origin: ui
      package: '@netlify/plugin-gatsby'
  redirects:
10:20:40 AM: Build failed due to an internal system error: Build script returned non-zero exit code: 4
10:20:40 AM: Failing build: Failed to build site
10:20:40 AM: Finished processing build request in 3m29.502s

I’ve sent this to the helpdesk. You should hear back soon.

1 Like