Node.js 如何修复:“;错误fsevents@2.0.7:月台;linux“;与本模块不兼容。”;
我想将我的网站部署到Heroku,但出现下一个错误:Node.js 如何修复:“;错误fsevents@2.0.7:月台;linux“;与本模块不兼容。”;,node.js,heroku,npm,yarnpkg,mern,Node.js,Heroku,Npm,Yarnpkg,Mern,我想将我的网站部署到Heroku,但出现下一个错误: error fsevents@2.0.7: The platform "linux" is incompatible with this module. error Found incompatible module. 我已经试过升级纱线,但没用。我使用macOS Mojave v 10.14.5,我不明白linux为什么会出现在这里 remote: -----> Installing binaries remote:
error fsevents@2.0.7: The platform "linux" is incompatible with this module.
error Found incompatible module.
我已经试过升级纱线,但没用。我使用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.
我去掉了线
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==
及
从纱线.锁
。下一步,我删除
"fsevents": "2.0.7",
从resolutions
输入package.json
最后在纱线安装上
我可以看到
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.
及
您不需要此模块,因为此模块仅适用于MacOS 对Node.js中MacOS FSEvents的本机访问
我现在得到了错误,但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/ 部署到Heroku
我没有修改
warn.lock
或任何其他文件。我最终来到了邮报,因为我对这个错误很好奇,现在我知道它只适用于macOS。换言之,忽略错误,留下纱线。锁定。我被困在同一个问题上超过一个月,我放弃了,我尝试了一切可能的方法,搜索了所有的互联网来寻找解决方案,但没有任何方法可以解决这个问题。所以我改为yarnJust a heads up,这个建议对heroku可能有效,但对其他服务可能无效。在许多情况下,这仍然是一个致命的错误,删除它或以某种方式使其仅适用于macos或本地开发(可能将其转换为devDependency,您在本地使用,并且当您在linux上其他地方构建时,您将使用$NODE_ENV of production?)仍然是正确的修复方法,在我不那么谦虚的观点中:)
success Saved lockfile.
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.