This repository was archived by the owner on Apr 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 140
Fails to deploy to Netlify. `Error: 'darwin-x64' binaries cannot be used on the 'linux-x64' platform.' #418
Copy link
Copy link
Open
Description
Hi there,
My site works great locally. However, when I followed the instructions provided here in order to deploy to Netlify the deployment failed:
"https://www.sanity.io/blog/how-to-quickly-set-up-a-gatsby-js-jamstack-website-with-a-headless-cms"
I get multiple errors when attempting to deploy to Netlify:
Error: 'darwin-x64' binaries cannot be used on the 'linux-x64' platform. Pleas e remove the 'node_modules/sharp' directory and run 'npm install' on the 'linux-x64' platform.
Here's the full failed deploy log:
4:30:27 PM: Build ready to start
4:30:29 PM: build-image version: 53b83b6bede2920f236b25b6f5a95334320dc849
4:30:29 PM: build-image tag: v3.6.0
4:30:29 PM: buildbot version: 9439037c11fb06c8c7a70d41fbf4be866b228390
4:30:29 PM: Fetching cached dependencies
4:30:29 PM: Failed to fetch cache, continuing with build
4:30:29 PM: Starting to prepare the repo for build
4:30:29 PM: No cached dependencies found. Cloning fresh repo
4:30:29 PM: git clone https://github.com/StudioCC17/chris-new
4:30:33 PM: Preparing Git Reference refs/heads/main
4:30:34 PM: Different build dir detected, going to use the one specified in the Netlify configuration file: 'web' versus '' in the Netlify UI
4:30:34 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'web/public' versus 'public' in the Netlify UI
4:30:34 PM: Starting build script
4:30:34 PM: Installing dependencies
4:30:34 PM: Python version set to 2.7
4:30:35 PM: v12.18.0 is already installed.
4:30:36 PM: Now using node v12.18.0 (npm v6.14.4)
4:30:36 PM: Started restoring cached build plugins
4:30:36 PM: Finished restoring cached build plugins
4:30:36 PM: Attempting ruby version 2.7.1, read from environment
4:30:37 PM: Using ruby version 2.7.1
4:30:38 PM: Using PHP version 5.6
4:30:38 PM: Started restoring cached node modules
4:30:38 PM: Finished restoring cached node modules
4:30:38 PM: Installing NPM modules using NPM version 6.14.4
4:31:13 PM: > core-js@2.6.10 postinstall /opt/build/repo/web/node_modules/core-js
4:31:13 PM: > node postinstall || echo "ignore"
4:31:13 PM: > core-js-pure@3.4.7 postinstall /opt/build/repo/web/node_modules/core-js-pure
4:31:13 PM: > node -e "try{require('./postinstall')}catch(e){}"
4:31:13 PM: > core-js@3.4.7 postinstall /opt/build/repo/web/node_modules/prettier-eslint-cli/node_modules/core-js
4:31:13 PM: > node -e "try{require('./postinstall')}catch(e){}"
4:31:14 PM: > core-js@3.4.7 postinstall /opt/build/repo/web/node_modules/prettier-eslint/node_modules/core-js
4:31:14 PM: > node -e "try{require('./postinstall')}catch(e){}"
4:31:14 PM: > gatsby-telemetry@1.1.42 postinstall /opt/build/repo/web/node_modules/gatsby-telemetry
4:31:14 PM: > node src/postinstall.js || true
4:31:14 PM: > gatsby-cli@2.8.16 postinstall /opt/build/repo/web/node_modules/gatsby/node_modules/gatsby-cli
4:31:14 PM: > node scripts/postinstall.js
4:31:14 PM: > @cloudflare/wrangler@1.12.2 postinstall /opt/build/repo/web/node_modules/@cloudflare/wrangler
4:31:14 PM: > node ./install-wrangler.js
4:31:14 PM: Downloading release https://workers.cloudflare.com/get-npm-wrangler-binary/1.12.2/x86_64-unknown-linux-musl
4:31:16 PM: wrangler has been installed!
4:31:16 PM: > gatsby@2.18.7 postinstall /opt/build/repo/web/node_modules/gatsby
4:31:16 PM: > node scripts/postinstall.js
4:31:18 PM: npm WARN example-company-website-gatsby-sanity-combo-frontend@1.0.0 No description
4:31:18 PM: npm WARN example-company-website-gatsby-sanity-combo-frontend@1.0.0 No repository field.
4:31:18 PM: npm WARN example-company-website-gatsby-sanity-combo-frontend@1.0.0 No license field.
4:31:18 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
4:31:18 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
4:31:18 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules/chokidar/node_modules/fsevents):
4:31:18 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
4:31:18 PM: added 1883 packages from 883 contributors and audited 1956 packages in 39.726s
4:31:20 PM: 19 packages are looking for funding
4:31:20 PM: run `npm fund` for details
4:31:20 PM: found 831 vulnerabilities (810 low, 8 moderate, 13 high)
4:31:20 PM: run `npm audit fix` to fix them, or `npm audit` for details
4:31:20 PM: NPM modules installed
4:31:20 PM: Started restoring cached go cache
4:31:20 PM: Finished restoring cached go cache
4:31:20 PM: go version go1.14.4 linux/amd64
4:31:20 PM: go version go1.14.4 linux/amd64
4:31:20 PM: Installing missing commands
4:31:20 PM: Verify run directory
4:31:22 PM:
4:31:22 PM: ────────────────────────────────────────────────────────────────
4:31:22 PM: Netlify Build
4:31:22 PM: ────────────────────────────────────────────────────────────────
4:31:22 PM:
4:31:22 PM: ❯ Version
4:31:22 PM: @netlify/build 7.0.0
4:31:22 PM:
4:31:22 PM: ❯ Flags
4:31:22 PM: buildImagePluginsDir: /opt/buildhome/.netlify-build-plugins/node_modules
4:31:22 PM: deployId: 5fd39ea38fce210ecb88a069
4:31:22 PM: mode: buildbot
4:31:22 PM:
4:31:22 PM: ❯ Current directory
4:31:22 PM: /opt/build/repo/web
4:31:22 PM:
4:31:22 PM: ❯ Config file
4:31:22 PM: /opt/build/repo/netlify.toml
4:31:22 PM:
4:31:22 PM: ❯ Context
4:31:22 PM: production
4:31:22 PM:
4:31:22 PM: ────────────────────────────────────────────────────────────────
4:31:22 PM: 1. build.command from netlify.toml
4:31:22 PM: ────────────────────────────────────────────────────────────────
4:31:22 PM:
4:31:22 PM: $ npm run build
4:31:22 PM: > example-company-website-gatsby-sanity-combo-frontend@1.0.0 build /opt/build/repo/web
4:31:22 PM: > gatsby build
4:31:24 PM: success open and validate gatsby-configs - 0.017s
4:31:24 PM: warning Plugin gatsby-plugin-manifest is not compatible with your gatsby version 2.18.7 - It requires gatsby@^2.25.0
4:31:25 PM: error Error in "/opt/build/repo/node_modules/gatsby-plugin-manifest/gatsby-node.js": 'darwin-x64' binaries cannot be used on the 'linux-x64' platform. Please remove the 'node_modules/sharp' directory and run 'npm install' on the 'linux-x64' platform.
4:31:25 PM:
4:31:25 PM:
4:31:25 PM: Error: 'darwin-x64' binaries cannot be used on the 'linux-x64' platform. Pleas e remove the 'node_modules/sharp' directory and run 'npm install' on the 'linu x-x64' platform.
4:31:25 PM:
4:31:25 PM: - libvips.js:62 Object.hasVendoredLibvips
4:31:25 PM: [repo]/[sharp]/lib/libvips.js:62:13
4:31:25 PM:
4:31:25 PM: - constructor.js:7 Object.<anonymous>
4:31:25 PM: [repo]/[sharp]/lib/constructor.js:7:22
4:31:25 PM:
4:31:25 PM: - v8-compile-cache.js:178 Module._compile
4:31:25 PM: [web]/[v8-compile-cache]/v8-compile-cache.js:178:30
4:31:25 PM:
4:31:25 PM: - loader.js:1158 Object.Module._extensions..js
4:31:25 PM: internal/modules/cjs/loader.js:1158:10
4:31:25 PM:
4:31:25 PM: - loader.js:986 Module.load
4:31:25 PM: internal/modules/cjs/loader.js:986:32
4:31:25 PM:
4:31:25 PM: - loader.js:879 Function.Module._load
4:31:25 PM: internal/modules/cjs/loader.js:879:14
4:31:25 PM:
4:31:25 PM: - loader.js:1026 Module.require
4:31:25 PM: internal/modules/cjs/loader.js:1026:19
4:31:25 PM:
4:31:25 PM: - v8-compile-cache.js:159 require
4:31:25 PM: [web]/[v8-compile-cache]/v8-compile-cache.js:159:20
4:31:25 PM:
4:31:25 PM: - index.js:3 Object.<anonymous>
4:31:25 PM: [repo]/[sharp]/lib/index.js:3:15
4:31:25 PM:
4:31:25 PM: - v8-compile-cache.js:178 Module._compile
4:31:25 PM: [web]/[v8-compile-cache]/v8-compile-cache.js:178:30
4:31:25 PM:
4:31:25 PM: - loader.js:1158 Object.Module._extensions..js
4:31:25 PM: internal/modules/cjs/loader.js:1158:10
4:31:25 PM:
4:31:25 PM: - loader.js:986 Module.load
4:31:25 PM: internal/modules/cjs/loader.js:986:32
4:31:25 PM:
4:31:25 PM: - loader.js:879 Function.Module._load
4:31:25 PM: internal/modules/cjs/loader.js:879:14
4:31:25 PM:
4:31:25 PM: - loader.js:1026 Module.require
4:31:25 PM: internal/modules/cjs/loader.js:1026:19
4:31:25 PM:
4:31:25 PM: - v8-compile-cache.js:159 require
4:31:25 PM: [web]/[v8-compile-cache]/v8-compile-cache.js:159:20
4:31:25 PM:
4:31:25 PM: - safe-sharp.js:132 Object.<anonymous>
4:31:25 PM: [repo]/[gatsby-plugin-manifest]/safe-sharp.js:132:11
4:31:25 PM:
4:31:25 PM:
4:31:25 PM: not finished load plugins - 0.347s
4:31:25 PM: npm ERR! code ELIFECYCLE
4:31:25 PM: npm ERR! errno 1
4:31:25 PM: npm ERR! example-company-website-gatsby-sanity-combo-frontend@1.0.0 build: `gatsby build`
4:31:25 PM: npm ERR! Exit status 1
4:31:25 PM: npm ERR!
4:31:25 PM: npm ERR! Failed at the example-company-website-gatsby-sanity-combo-frontend@1.0.0 build script.
4:31:25 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
4:31:25 PM: npm ERR! A complete log of this run can be found in:
4:31:25 PM: npm ERR! /opt/buildhome/.npm/_logs/2020-12-11T16_31_25_291Z-debug.log
4:31:25 PM:
4:31:25 PM: ────────────────────────────────────────────────────────────────
4:31:25 PM: "build.command" failed
4:31:25 PM: ────────────────────────────────────────────────────────────────
4:31:25 PM:
4:31:25 PM: Error message
4:31:25 PM: Command failed with exit code 1: npm run build
4:31:25 PM:
4:31:25 PM: Error location
4:31:25 PM: In build.command from netlify.toml:
4:31:25 PM: npm run build
4:31:25 PM:
4:31:25 PM: Resolved config
4:31:25 PM: build:
4:31:25 PM: base: /opt/build/repo/web
4:31:25 PM: command: npm run build
4:31:25 PM: commandOrigin: config
4:31:25 PM: publish: /opt/build/repo/web/public
4:31:25 PM: Caching artifacts
4:31:25 PM: Started saving node modules
4:31:25 PM: Finished saving node modules
4:31:25 PM: Started saving build plugins
4:31:25 PM: Finished saving build plugins
4:31:25 PM: Started saving pip cache
4:31:25 PM: Finished saving pip cache
4:31:25 PM: Started saving emacs cask dependencies
4:31:25 PM: Finished saving emacs cask dependencies
4:31:25 PM: Started saving maven dependencies
4:31:25 PM: Finished saving maven dependencies
4:31:25 PM: Started saving boot dependencies
4:31:25 PM: Finished saving boot dependencies
4:31:25 PM: Started saving rust rustup cache
4:31:25 PM: Finished saving rust rustup cache
4:31:25 PM: Started saving rust cargo bin cache
4:31:25 PM: Finished saving rust cargo bin cache
4:31:25 PM: Started saving go dependencies
4:31:25 PM: Finished saving go dependencies
4:31:28 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
4:31:28 PM: Failing build: Failed to build site
4:31:28 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
4:31:28 PM: Finished processing build request in 59.498523782s
I've tried removing the sharp directory and reinstalling but doesn't solve anything.
I've had a great, smooth experience with Sanity so far but cannot seem to solve this issue. Hoping someone can help me out here.
Metadata
Metadata
Assignees
Labels
No labels