PROD构建中纱线安装失败。错误-“ chalk@4.1.0:引擎“节点”与此模块不兼容”

时间:2020-07-03 05:16:27

标签: javascript reactjs npm webpack yarnpkg

我正在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中没有任何代码更改

1 个答案:

答案 0 :(得分:1)

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

相关问题