【问题标题】:Yarn Install failing on PROD build. Error - "chalk@4.1.0: The engine "node" is incompatible with this module"在 PROD 构建时纱线安装失败。错误 - “chalk@4.1.0:引擎“节点”与此模块不兼容”
【发布时间】:2020-07-03 05:16:27
【问题描述】:

我正在 PROD 环境中部署 ReactJS 项目。 早些时候它工作正常,但现在命令“Yarn install”失败。

遇到错误

info fsevents@1.2.13: The platform "linux" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
error chalk@4.1.0: The engine "node" is incompatible with this module. Expected version ">=10".
error Found incompatible module

pacakage.json 中没有任何代码更改

【问题讨论】:

  • 错误不言自明?
  • @xMayank 但它在我的本地工作。不在产品上。并具有相同的 nodejs 版本

标签: javascript reactjs npm webpack yarnpkg


【解决方案1】:

原因可能是 Chalk[1] 版本 4 中的重大更改。如果您真的在生产环境中使用节点版本 10.x,请再次确认。直接在部署管道中打印出版本(node -v)是最简单的。

【讨论】:

    猜你喜欢
    • 2019-10-30
    • 2020-11-17
    • 2021-03-22
    • 2021-07-20
    • 1970-01-01
    • 1970-01-01
    • 2020-01-03
    • 1970-01-01
    相关资源
    最近更新 更多