安装npm依赖时报node版本不支持问题解决办法

安装npm依赖时报node版本不支持问题解决办法

admin
2024-02-26 / 0 评论 / 70 阅读 / 正在检测是否收录...

安装npm依赖时报如下错误

[2024-02-26 18:00:32]error webpack-dev-middleware@7.0.0: The engine "node" is incompatible with this module. Expected version ">= 18.12.0". Got "16.15.1"
[2024-02-26 18:00:32]error Found incompatible module.
[2024-02-26 18:00:32]info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
[2024-02-26 18:00:32]The command "yarn" exited with 1.

手动删除 node_modules 目录并且清空了npm缓存 npm cache clean --force 重新安装还是不行

执行以下命令,禁止npm扫描所有包的 engine -> node 选项

yarn config set ignore-engines true
0

评论 (0)

取消