简体   繁体   English

如何修复:“错误 fsevents@2.0.7:平台“linux”与此模块不兼容。”

[英]How to fix: "error fsevents@2.0.7: The platform "linux" is incompatible with this module."

I want to deploy my website to Heroku but I get the next error:我想将我的网站部署到 Heroku,但出现下一个错误:

error fsevents@2.0.7: The platform "linux" is incompatible with this module.
error Found incompatible module.

I've already tried upgrading yarn, node but it didn't help.我已经尝试过升级yarn、node,但没有帮助。 I use macOS Mojave v 10.14.5 and I cannot understand why is linux here.我使用 macOS Mojave v 10.14.5,我不明白为什么 linux 在这里。



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 fsevents@2.0.7: 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 .来自yarn.lock Next I removed接下来我删除了

    "fsevents": "2.0.7",

from resolutions key in package.json来自package.json resolutions

Finally on yarn install I can see最后在yarn install我可以看到

info fsevents@2.0.7: The platform "linux" is incompatible with this module.
info "fsevents@2.0.7" 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您不需要此模块,因为它仅适用于 MacOS

Native access to MacOS FSEvents in Node.js在 Node.js 中本地访问 MacOS FSEvents

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

I'm getting the error now, but Heroku excludes fsevents and results in a successful deploy.我现在收到错误消息,但 Heroku 排除了 fsevents 并导致部署成功。

info fsevents@2.1.3: The platform "linux" is incompatible with this module.
remote:        info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
remote:        info fsevents@1.2.13: The platform "linux" is incompatible with this module.
remote:        info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.

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

I didn't modify yarn.lock or any other files.我没有修改yarn.lock或任何其他文件。 I ended up at the post because I was curious about the error and now I know it's for macOS only.我结束了这篇文章,因为我对这个错误很好奇,现在我知道它只适用于 macOS。 In other words ignore the error and leave yarn.lock alone.换句话说,忽略错误并留下yarn.lock

yarn --ignore-platform这将解决问题

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法在ubuntu中进行安装(fsevents@1.2.4:平台“ linux”与此模块不兼容) - unable to yarn install in ubuntu(fsevents@1.2.4: The platform “linux” is incompatible with this module) 如何修复“TypeError:fsevents 不是构造函数”反应错误 - How to fix "TypeError: fsevents is not a constructor" react error 安装strapi时出错。 安装“sharp”模块出了点问题。 如何修复它 - Got error on installation of strapi. something went wrong installing the "sharp" module. How to fix it npm安装错误fsevents 1和fsevents 2如何解决? - how to solve the npm installation error fsevents 1 and fsevents 2? 错误 eslint@5.6.0:引擎“节点”与此模块不兼容。 尝试创建反应应用程序时 - error eslint@5.6.0: The engine "node" is incompatible with this module. when trying to create-react-app 错误 find-up@4.1.0:引擎“节点”与此模块不兼容。 预期版本“&gt;=8”。 Ember js + Heroku 部署 - error find-up@4.1.0: The engine "node" is incompatible with this module. Expected version ">=8". Ember js + Heroku Deployment 引擎“节点”与此模块不兼容。 预期版本“&gt; 0.4.x &lt; 0.9.0”。 有“12.22.1”吗? 如何解决这个问题 - The engine “node” is incompatible with this module. Expected version “> 0.4.x < 0.9.0”. Got “12.22.1” ? How to solve this 安装Angular CLI时不受支持的fsevents平台错误 - Unsupported platform for fsevents error on installing Angular cli npx create-react-app -&gt; 引擎“节点”与此模块不兼容。 预期版本 "&gt;= 10.x"。 得到“8.16.0”-Arch Linux - npx create-react-app -> The engine "node" is incompatible with this module. Expected version ">= 10.x". Got "8.16.0" - Arch Linux Laravel/Vue/Heroku - 不支持在平台 linux 上跳过“fsevents”构建 - Laravel/Vue/Heroku - Skipping 'fsevents' build as platform linux is not supported
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM