Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I want to deploy my website to Heroku but I get the next error:

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

I've already tried upgrading yarn, node but it didn't help. I use macOS Mojave v 10.14.5 and I cannot understand why is linux here.



remote: -----> Installing binaries
remote:        engines.node (package.json):  10.15.3
remote:        engines.npm (package.json):   unspecified (use default)
remote:        engines.yarn (package.json):  unspecified (use default)
remote:        
remote:        Resolving node version 10.15.3...
remote:        Downloading and installing node 10.15.3...
remote:        Using default npm version: 6.4.1
remote:        Resolving yarn version 1.x...
remote:        Downloading and installing yarn (1.17.3)...
remote:        Installed yarn 1.17.3
remote:        
remote: -----> Installing dependencies
remote:        Installing node modules (yarn.lock)
remote:        yarn install v1.17.3
remote:        [1/4] Resolving packages...
remote:        [2/4] Fetching packages...
error [email protected]: The platform "linux" is incompatible with this module.
remote:        error Found incompatible module.

like image 444
Ilya Solodeev Avatar asked Jul 17 '19 18:07

Ilya Solodeev


3 Answers

I removed lines

fsevents@^1.2.7, fsevents@^2.0.6:
  version "2.0.7"
  resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.0.7.tgz#382c9b443c6cbac4c57187cdda23aa3bf1ccfc2a"
  integrity sha512-a7YT0SV3RB+DjYcppwVDLtn13UQnmg0SWZS7ezZD0UjnLwXmy8Zm21GMVGLaFGimIqcvyMQaOJBrop8MyOp1kQ==

and

  optionalDependencies:
    fsevents "^2.0.6"

from yarn.lock. Next I removed

    "fsevents": "2.0.7",

from resolutions key in package.json

Finally on yarn install I can see

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.

and

success Saved lockfile.

You do not need this module because of this is only for MacOS

Native access to MacOS FSEvents in Node.js

https://www.npmjs.com/package/fsevents

like image 63
Daniel Avatar answered Nov 15 '22 03:11

Daniel


yarn --ignore-platform This will fix the issue. As the name suggests it'll ignore the platform(Mac/Linux) and install those dependencies.

like image 24
Sougata Das Avatar answered Nov 15 '22 04:11

Sougata Das


I'm getting the error now, but Heroku excludes fsevents and results in a successful deploy.

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

https://my-app.herokuapp.com/ deployed to Heroku.

I didn't modify yarn.lock or any other files. I ended up at the post because I was curious about the error and now I know it's for macOS only. In other words ignore the error and leave yarn.lock alone.

like image 3
Greg Avatar answered Nov 15 '22 04:11

Greg