关于前端项目运行不兼容20.10.0的解决方法

最近,安装了Node最新的版本20.10.0,在执行yarn安装依赖时爆了如下的错误。

error @achrinza/node-ipc@9.2.2: The engine "node" is incompatible with this module. Expected version "8 || 10 || 12 || 14 || 16 || 17". Got "20.10.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

如果逐个的进行升级,可能会比较麻烦,那我们可以使用如下的命令来忽略引擎的检查,命令如下。

yarn config set ignore-engines true

执行完上面的命令后,会看到如下的提示。

xianghong@xiangdembp vue-music % yarn config set ignore-engines true
yarn config v1.22.19
success Set "ignore-engines" to "true".
✨  Done in 0.04s.

此时,再次执行yarn install命令安装以来包就没有任何的问题了。


评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注