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.
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
yarn --ignore-platform
This will fix the issue. As the name suggests it'll ignore the platform(Mac/Linux) and install those dependencies.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With