Failed build (The platform "linux" is incompatible with this module)

Hello i’m using Gridsome, like many of my projects.

I cloned 1 repo that is already online and it is working. I pushed the cloned repo on another repo of github and connected it to netlify but the build is failing any help? maybe the rrore is “The platform “linux” is incompatible with this module” here my error

Hey @93lucasp

If deploy logs are public, can you share the link to it (much more helpful than a screenshot)

Are you able to share the repository? If not, can you share the project package.json.

here a similar issue https://answers.netlify.com/t/fork-ts-checker-webpack-plugin-incompatible-with-yarn/6013 i tried to change the yarn version with the variable but same issue

My package.json is:

{
  "name": "my-gridsome-site",
  "private": true,
  "scripts": {
    "build": "gridsome build",
    "develop": "gridsome develop",
    "explore": "gridsome explore"
  },
  "dependencies": {
    "@gridsome/plugin-google-analytics": "^0.1.0",
    "@gridsome/plugin-sitemap": "^0.2.3",
    "@gridsome/source-filesystem": "^0.6.2",
    "@gridsome/transformer-remark": "^0.4.0",
    "gridsome": "^0.7.0",
    "node-sass": "^4.13.1",
    "sass-loader": "^8.0.2"
  }
}

The url of the build is this: Netlify App but i am not sure you will be able to see it :confused:

This is your issue. If you are using the latest build image (I assume you are as the deploy log is private so I cannot tell for sure) you are using an incompatible version of node-sass. There are several posts in these forums about node-sass

Upgrade the version of node-sass to that compatible with node.js v16 (see npm package listing) or downgrade the version of node.js used by the build image to one compatible with that version of node-sass (see Manage build dependencies.)

1 Like

mmmm but in another repo i have the same and it’s working correctly :confused:

Anyway this is the deploy log:

8:17:03 AM: Build ready to start
8:17:04 AM: build-image version: d2c6dbeac570350a387d832f64bc980dc964ad65 (focal)
8:17:04 AM: build-image tag: v4.8.0
8:17:04 AM: buildbot version: 17f6c1ab2fe6d61574ce02b038041b816bf6c085
8:17:05 AM: Building without cache
8:17:05 AM: Starting to prepare the repo for build
8:17:05 AM: No cached dependencies found. Cloning fresh repo
8:17:05 AM: git clone https://github.com/logix-software/webSite-en
8:17:06 AM: Preparing Git Reference refs/heads/main
8:17:07 AM: Parsing package.json dependencies
8:17:08 AM: Starting build script
8:17:08 AM: Installing dependencies
8:17:08 AM: Python version set to 2.7
8:17:09 AM: Downloading and installing node v16.15.0...
8:17:09 AM: Downloading https://nodejs.org/dist/v16.15.0/node-v16.15.0-linux-x64.tar.xz...
8:17:09 AM: Computing checksum with sha256sum
8:17:09 AM: Checksums matched!
8:17:12 AM: Now using node v16.15.0 (npm v8.5.5)
8:17:12 AM: Started restoring cached build plugins
8:17:12 AM: Finished restoring cached build plugins
8:17:12 AM: Attempting ruby version 2.7.2, read from environment
8:17:13 AM: Using ruby version 2.7.2
8:17:13 AM: Using PHP version 8.0
8:17:13 AM: Started restoring cached yarn cache
8:17:13 AM: Finished restoring cached yarn cache
8:17:14 AM: No yarn workspaces detected
8:17:14 AM: Started restoring cached node modules
8:17:14 AM: Finished restoring cached node modules
8:17:14 AM: Installing NPM modules using Yarn version 1.22.10
8:17:14 AM: yarn install v1.22.10
8:17:14 AM: [1/4] Resolving packages...
8:17:15 AM: [2/4] Fetching packages...
8:17:18 AM: warning mini-css-extract-plugin@0.5.0: Invalid bin field for "mini-css-extract-plugin".
8:17:19 AM: warning url-loader@1.1.2: Invalid bin field for "url-loader".
8:17:28 AM: info fsevents@1.2.11: The platform "linux" is incompatible with this module.
8:17:28 AM: info "fsevents@1.2.11" is an optional dependency and failed compatibility check. Excluding it from installation.
8:17:28 AM: [3/4] Linking dependencies...
8:17:28 AM: warning " > sass-loader@8.0.2" has unmet peer dependency "webpack@^4.36.0 || ^5.0.0".
8:17:33 AM: [4/4] Building fresh packages...
8:17:42 AM: error /opt/build/repo/node_modules/sharp: Command failed.
8:17:42 AM: Exit code: 1
8:17:42 AM: Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
8:17:42 AM: Arguments:
8:17:42 AM: Directory: /opt/build/repo/node_modules/sharp
8:17:42 AM: Output:
8:17:42 AM: info sharp Detected globally-installed libvips v8.9.1
8:17:42 AM: info sharp Building from source via node-gyp
8:17:42 AM: gyp info it worked if it ends with ok
8:17:42 AM: gyp info using node-gyp@9.0.0
8:17:42 AM: gyp info using node@16.15.0 | linux | x64
8:17:42 AM: gyp info find Python using Python version 3.8.10 found at "/usr/bin/python3"
8:17:42 AM: gyp http GET https://nodejs.org/download/release/v16.15.0/node-v16.15.0-headers.tar.gz
8:17:42 AM: gyp http 200 https://nodejs.org/download/release/v16.15.0/node-v16.15.0-headers.tar.gz
8:17:42 AM: gyp http GET https://nodejs.org/download/release/v16.15.0/SHASUMS256.txt
8:17:42 AM: gyp http 200 https://nodejs.org/download/release/v16.15.0/SHASUMS256.txt
8:17:42 AM: gyp info spawn /usr/bin/python3
8:17:42 AM: gyp info spawn args [
8:17:42 AM: gyp info spawn args   '/opt/buildhome/.nvm/versions/node/v16.15.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
8:17:42 AM: gyp info spawn args   'binding.gyp',
8:17:42 AM: gyp info spawn args   '-f',
8:17:42 AM: gyp info spawn args   'make',
8:17:42 AM: gyp info spawn args   '-I',
8:17:42 AM: gyp info spawn args   '/opt/build/repo/node_modules/sharp/build/config.gypi',
8:17:42 AM: gyp info spawn args   '-I',
8:17:42 AM: gyp info spawn args   '/opt/buildhome/.nvm/versions/node/v16.15.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
8:17:42 AM: gyp info spawn args   '-I',
8:17:42 AM: gyp info spawn args   '/opt/buildhome/.cache/node-gyp/16.15.0/include/node/common.gypi',
8:17:42 AM: gyp info spawn args   '-Dlibrary=shared_library',
8:17:42 AM: gyp info spawn args   '-Dvisibility=default',
8:17:42 AM: gyp info spawn args   '-Dnode_root_dir=/opt/buildhome/.cache/node-gyp/16.15.0',
8:17:42 AM: gyp info spawn args   '-Dnode_gyp_dir=/opt/buildhome/.nvm/versions/node/v16.15.0/lib/node_modules/npm/node_modules/node-gyp',
8:17:42 AM: gyp info spawn args   '-Dnode_lib_file=/opt/buildhome/.cache/node-gyp/16.15.0/<(target_arch)/node.lib',
8:17:42 AM: gyp info spawn args   '-Dmodule_root_dir=/opt/build/repo/node_modules/sharp',
8:17:42 AM: gyp info spawn args   '-Dnode_engine=v8',
8:17:42 AM: gyp info spawn args   '--depth=.',
8:17:42 AM: gyp info spawn args   '--no-parallel',
8:17:42 AM: gyp info spawn args   '--generator-output',
8:17:42 AM: gyp info spawn args   'build',
8:17:42 AM: gyp info spawn args   '-Goutput_dir=.'
8:17:42 AM: gyp info spawn args ]
8:17:42 AM: gyp info spawn make
8:17:42 AM: gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
8:17:42 AM: make: Entering directory '/opt/build/repo/node_modules/sharp/build'
8:17:42 AM:   TOUCH Release/obj.target/libvips-cpp.stamp
8:17:42 AM:   CXX(target) Release/obj.target/sharp/src/common.o
8:17:42 AM: In file included from /opt/buildhome/.cache/node-gyp/16.15.0/include/node/v8.h:30,
8:17:42 AM:                  from /opt/buildhome/.cache/node-gyp/16.15.0/include/node/node.h:63,
8:17:42 AM:                  from ../src/common.cc:22:
8:17:42 AM: /opt/buildhome/.cache/node-gyp/16.15.0/include/node/v8-internal.h: In function ‘void v8::internal::PerformCastCheck(T*)’:
8:17:42 AM: /opt/buildhome/.cache/node-gyp/16.15.0/include/node/v8-internal.h:492:38: error: ‘remove_cv_t’ is not a member of ‘std’; did you mean ‘remove_cv’?
8:17:42 AM:   492 |             !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
8:17:42 AM:       |                                      ^~~~~~~~~~~
8:17:42 AM:       |                                      remove_cv
8:17:42 AM: /opt/buildhome/.cache/node-gyp/16.15.0/include/node/v8-internal.h:492:38: error: ‘remove_cv_t’ is not a member of ‘std’; did you mean ‘remove_cv’?
8:17:42 AM:   492 |             !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
8:17:42 AM:       |                                      ^~~~~~~~~~~
8:17:42 AM:       |                                      remove_cv
8:17:42 AM: /opt/buildhome/.cache/node-gyp/16.15.0/include/node/v8-internal.h:492:50: error: template argument 2 is invalid
8:17:42 AM:   492 |             !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
8:17:42 AM:       |                                                  ^
8:17:42 AM: /opt/buildhome/.cache/node-gyp/16.15.0/include/node/v8-internal.h:492:63: error: ‘::Perform’ has not been declared
8:17:42 AM:   492 |             !std::is_same<Data, std::remove_cv_t<T>>::value>::Perform(data);
8:17:42 AM:       |                                                               ^~~~~~~
8:17:42 AM: make: *** [sharp.target.mk:183: Release/obj.target/sharp/src/common.o] Error 1
8:17:42 AM: make: Leaving directory '/opt/build/repo/node_modules/sharp/build'
8:17:42 AM: gyp ERR! build error
8:17:42 AM: gyp ERR! stack Error: `make` failed with exit code: 2
8:17:42 AM: gyp ERR! stack     at ChildProcess.onExit (/opt/buildhome/.nvm/versions/node/v16.15.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
8:17:42 AM: gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
8:17:42 AM: gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
8:17:42 AM: gyp ERR! System Linux 5.4.181-99.354.amzn2.x86_64
8:17:42 AM: gyp ERR! command "/opt/buildhome/.nvm/versions/node/v16.15.0/bin/node" "/opt/buildhome/.nvm/versions/node/v16.15.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
8:17:42 AM: gyp ERR! cwd /opt/build/repo/node_modules/sharp
8:17:42 AM: gyp ERR! node -v v16.15.0
8:17:42 AM: gyp ERR! node-gyp -v v9.0.0
8:17:42 AM: gyp ERR! not ok
8:17:42 AM: info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
8:19:35 AM: Error during Yarn install
8:19:35 AM: Creating deploy upload records
8:19:35 AM: Build was terminated: Build script returned non-zero exit code: 1
8:19:35 AM: Failing build: Failed to build site
8:19:35 AM: Failed during stage 'building site': Build script returned non-zero exit code: 1 (https://ntl.fyi/exit-code-1)
8:19:35 AM: Finished processing build request in 2m30.634353567s

The build is using Node.js v16.15.0. Node.js 16 only supports node-sass v6.0+ as per above link.

Ok thanks, maybe for old deploy they continue to use old one :confused: Thanks a lot :slight_smile:

The Node.js version is “pinned” so that it will not change—this avoids introducing breaking changes—as per this documentation.

2 Likes