Yarn: Yarn attempts to rebuild fsevents even on incompatible operating systems

Created on 28 Nov 2016  Â·  30Comments  Â·  Source: yarnpkg/yarn

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
fsevents is only relevant on Mac OS, it does not compile on Linux or Windows. Yarn appears to try and compile it even on incompatible operating system. This is a waste of time as it's always going to fail.

If the current behavior is a bug, please provide the steps to reproduce.
This is the package.json from one of my sites:

{
  "name": "sitename",
  "version": "0.0.0",
  "description": "",
  "main": "index.js",
  "devDependencies": {
    "assets-webpack-plugin": "~3.0.0",
    "babel-core": "~5.8.25",
    "babel-loader": "~5.3.2",
    "exports-loader": "~0.6.2",
    "expose-loader": "~0.7.0",
    "imports-loader": "~0.6.4",
    "webpack": "~1.12.2"
  },
  "repository": {
    "type": "git",
    "url": "[email protected]:/var/local/git/sitename"
  },
  "author": "Daniel Lo Nigro <[email protected]> (http://dan.cx/)",
  "scripts": {
    "build-dev": "NODE_ENV=development webpack -d",
    "build-prod": "NODE_ENV=production webpack -p",
    "watch": "NODE_ENV=development webpack --progress --colors --watch -d",
    "update-babel-helpers": "babel-external-helpers -l get,inherits,create-class,class-call-check,extends,interop-require-default > ./public/assets/js/babel-external-helpers.js"
  },
  "dependencies": {
    "array.prototype.find": "~1.0.0",
    "babel-runtime": "~5.8.25",
    "classnames": "^2.1.5",
    "fbemitter": "^2.0.0",
    "flux": "~2.1.1",
    "react": "~0.14.0",
    "react-onclickoutside": "git://github.com/Daniel15/react-onclickoutside.git"
  }
}

Running yarn gives me this as part of the output:

[2/4] Fetching packages...
warning [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.

However, in the "Building fresh packages..." stage of installation, it still attempts to build the dependency, which obviously fails as it should only be built on Mac OS.

The installation still succeeds so this is not a blocker, it's just very odd behaviour.

The second time I run yarn, it shows that everything is up-to-date:

yarn install v0.17.8
warning [email protected]: No license field
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.28s.

However, when I add another dependency, it tries to build fsevents again.

What is the expected behavior?
Yarn should not attempt to build a native dependency if it's incompatible with the current OS

npm handles this correctly:

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]

Please mention your node.js, yarn and operating system version.
Yarn 0.17.8
Windows 10
Node.js 6.9.1

cat-bug

Most helpful comment

Still seeing it in 1.15.2, this is in a fresh node:8 container

yarn --network-timeout 100000 install  
yarn install v1.15.2
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...

All 30 comments

Having the same issue... makes the output look like there was an issue when running 'yarn install' and eats some extra seconds.

this problem should be solved with https://github.com/yarnpkg/yarn/pull/1997

Yes, confirmed fixed in latest nightly build:

yarn install v0.18.0-20161129.2058
info No lockfile found.
warning [email protected]: No license field
[1/4] Resolving packages...
warning babel-core > [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
[2/4] Fetching packages...
warning [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.

Doesn't seem to be fixed for linux. npm run yarn just runs yarn. The build is stuck forever after this warning.

Successfully built 926b219559f2
+ docker run --rm -v /var/jenkins_home/workspace/cloud-ui@2/cloud-ui:/src adminconsole-node:latest /bin/sh -c '
    set -ex;

    npm prune;

    npm install yarn >/dev/null;
    npm run yarn > /dev/null;

    npm run verify-deps;
    npm run lint;
    CI=true npm test;
  '
+ npm prune
+ npm install yarn
npm WARN prefer global [email protected] should be installed with -g
+ npm run yarn
warning [email protected]: The platform "linux" is incompatible with this module.

I am getting this error on a windows 7 machine and IT IS blocking me since I can't get any packages to install when it hits.

Still seeing this issue with yarn 1.9.4 on Azure DevOps (formerly VSTS)

Same issue on 1.9.4 with:

"resolutions": {
  "**/fsevents": ">=1.2.4"
}

It seems that this issue is back.

~Possibly related: I am on macOS, and fsevents is _rebuilding_ every time I run yarn, even if the correct version is already installed.~

~I don't think that used to happen. I think yarn used to finish immediately with the message "success Already up-to-date."~

~Of the 11 dependencies that need to be built on a fresh install, fsevents is the only dependency which rebuilds on every install.~

Update: I am happy to report that, after upgrading from 1.10.1 to 1.12.1, this problem has stopped. We have got the "Already up-to-date" message back, and short install times. Thank you!


My environment: yarn version 1.10.1

My package.json: (I tried but failed to narrow down the minimal deps needed to trigger this problem)

{
  "dependencies": {
    "@loopback/authentication": "^0.8.0",
    "@loopback/boot": "^0.8.0",
    "@loopback/context": "^0.8.0",
    "@loopback/core": "^0.6.0",
    "@loopback/openapi-v3": "^0.7.0",
    "@loopback/repository": "^0.8.0",
    "@loopback/repository-json-schema": "^0.6.0",
    "@loopback/rest": "^0.7.0",
    "@types/bitcoinjs-lib": "^3.4.0",
    "@types/ramda": "^0.25.32",
    "@types/socket.io": "^1.4.33",
    "@types/speakeasy": "^2.0.2",
    "@types/underscore": "^1.8.8",
    "bcrypt": "^2.0.0",
    "bignumber.js": "^7.2.1",
    "bitcoin-core": "^2.0.0",
    "bitcoind-rpc": "^0.7.1",
    "bitcoinjs-lib": "^3.3.2",
    "colors": "^1.3.1",
    "crypto": "^1.0.1",
    "crypto-js": "^3.1.9-1",
    "cryptocompare": "^0.5.0",
    "ethereumjs-tx": "^1.3.4",
    "forever": "^0.15.3",
    "geoip-lite": "^1.3.2",
    "i18n": "^0.8.3",
    "i18next": "^11.8.0",
    "loopback": "^3.19.0",
    "loopback-connector-mongodb": "^3.4.3",
    "memoizee": "^0.4.12",
    "nodemailer": "^4.6.8",
    "nodemailer-html-to-text": "^3.0.0",
    "nodemon": "^1.17.3",
    "passport-http": "^0.3.0",
    "ramda": "^0.25.0",
    "socket.io": "^2.1.0",
    "socket.io-fix-close": "^0.0.2",
    "socketio-auth": "^0.1.0",
    "speakeasy": "^2.0.0",
    "web3": "^1.0.0-beta.34",
    "web3-eth-personal": "^1.0.0-beta.34"
  },
  "devDependencies": {
    "@loopback/build": "^0.5.0",
    "@loopback/testlab": "^0.7.0",
    "@types/mocha": "^5.0.0",
    "@types/node": "^8.10.0",
    "@types/passport": "^0.4.5",
    "@types/passport-http": "^0.3.6",
    "@types/socket.io-client": "^1.4.32",
    "mocha": "^5.0.4",
    "socket.io-client": "^2.1.0",
    "source-map-support": "^0.5.4"
  }
}

Getting this issue with 1.10.1 too on linux

People getting this problem, you might try upgrading from 1.10.1 to 1.12.1. That has fixed it for us.

Getting this issue with 1.12.3, the install aborts with an error:

error [email protected]: The platform "linux" is incompatible with this module.
error Found incompatible module

Used to be a warning and the module used to be ignored.

This is with running yarn --pure-lockfile --production or yarn

Are you sure fsevents is listed as an optional dependency? If it's not
optional, it'll fail on Linux, which is expected.

Sent from my phone.

On Sun, Dec 30, 2018, 3:12 PM Adam Reis <[email protected] wrote:

Getting this issue with 1.12.3, the install aborts with an error:

error [email protected]: The platform "linux" is incompatible with this module.
error Found incompatible module

Used to be a warning and the module used to be ignored.

—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
https://github.com/yarnpkg/yarn/issues/2051#issuecomment-450593265, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAFnHb-blfOUg-LYdjrhDhh2wdpL6DTQks5u-UhygaJpZM4K9Tb7
.

It is a nested optional dependency, but I discovered that the problem was due to the following added lines in package.json:

"resolutions": {
    "nodemon/chokidar/fsevents": "1.2.4"
  }

This was needed to make it work with Node 10, but apparently manually adding the resolution forces yarn to try and install the package, even if it's an optional dependency.

Also saw this error. Updating node from 6 to 8 fixed it for us.

https://travis-ci.org/ember-infinity/ember-infinity/jobs/478166551

I also encountered this again, we had fsevents in resolutions because of some prior issue, but that wasn't necessary anymore. However, I still think yarn shouldn't fail on an optional package, even if it's specified in the resolutions. Those resolutions should only be used if the package is actually installed (which it shouldn't on linux).

Yarn still got this

PROMPT>yarn global add @nestjs/cli
yarn global v1.13.0

[1/4] Resolving packages...

[2/4] Fetching packages...

info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.

[3/4] Linking dependencies...

I had to use npm force install for this.

But did it worked afterwards? In my case not.

Still seeing it in 1.15.2, this is in a fresh node:8 container

yarn --network-timeout 100000 install  
yarn install v1.15.2
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...

Windows 10 Build 16299 system output:

λ yarn install
yarn install v1.17.3
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
Done in 61.98s.

My package.json:

{
    "name": "Test",
    "version": "0.1.0",
    "private": true,
    "scripts": {
        "serve": "vue-cli-service serve",
        "build": "vue-cli-service build",
        "lint": "vue-cli-service lint"
    },
    "dependencies": {
        "core-js": "^2.6.5",
        "vue": "^2.6.10",
        "vue-router": "^3.0.6"
    },
    "devDependencies": {
        "@vue/cli-plugin-babel": "^3.7.0",
        "@vue/cli-plugin-eslint": "^3.7.0",
        "@vue/cli-service": "^3.7.0",
        "@vue/eslint-config-standard": "^4.0.0",
        "babel-eslint": "^10.0.1",
        "eslint": "^5.16.0",
        "eslint-plugin-vue": "^5.0.0",
        "tailwindcss": "1.1",
        "vue-template-compiler": "^2.6.10"
    }
}

Try this

yarn config set ignore-engines true

Try this

yarn config set ignore-engines true

Thanks, this worked in my case too.

@ryantando

Try this
yarn config set ignore-engines true

Should that^^ stop the incessant, every-time-yarn-execs noise,

...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
...

as well?

If not, any hints as to what can/does?

I am still facing this issue with v1.22.4

yarn add notistack yarn add v1.22.4 [1/4] Resolving packages... [2/4] Fetching packages... info [email protected]: The platform "win32" is incompatible with this module. info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation. info [email protected]: The platform "win32" is incompatible with this module. info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... warning " > [email protected]" has unmet peer dependency "prop-types@^15.6.0". warning "react-scripts > @typescript-eslint/eslint-plugin > [email protected]" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".

I believe it somehow effects my surge deployment process. I'm creating a workflow in github actions but it fails.

yarn remove v1.22.4
[1/2] Removing module cra-template...
[2/2] Regenerating lockfile and installing missing dependencies...
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
warning " > @testing-library/[email protected]" has unmet peer dependency "@testing-library/dom@>=5".
warning "react-scripts > @typescript-eslint/eslint-plugin > [email protected]" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
success Uninstalled packages.

@adisher It's just a warning and shouldn't actually break anything.

Try this

yarn config set ignore-engines true

What are the side effects of this call?

@papadi Well, this is the yarn documentation for yarn install --ignore-engines:

Do not execute any scripts defined in the project package.json and its dependencies.

So I assume that somewhere in the install chain there is some script that tries to install fsevents. But turning this off for ever seems a bit more than required. You could just try running yarn install --ignore-engines for this case.

I need to switch to a specific node version and it worked. :)

I need to switch to a specific node version and it worked. :)

And what version of node was that?

Was this page helpful?
0 / 5 - 0 ratings