yarn、npm 安装Node包版本报错

596 阅读1分钟

yarn、npm 安装报错

运行一个项目新的时候,安装node包出现安装node的报错,error ora@8.0.1: The engine "node" is incompatible with this module. Expected version ">=18". Got "16.16.0" error Found incompatible module.提示我的node版本和要求的版本不符合,使用nvm切换版本之后依旧报错, 查找继续安装依赖的方法如下

忽略报错

yarn config set ignore-engines true

$ yarn config set ignore-engines true

yarn config v1.22.22
success Set "ignore-engines" to "true".
Done in 0.43s.

忽略yarn安装版本报错:error ora@8.0.1: The engine "node" is incompatible with this module. Expected version ">=18". Got "16.16.0" error Found incompatible module.

忽略错误后重新yarn install

刷新DNS

刷新刷新 DNS 解析缓存 还有 可以尝试重启电脑

shell> ipconfig /flushdns

Windows IP 配置

已成功刷新 DNS 解析缓存。

2024-08-06-19-58-19-image.png

清理缓存

npm cache clean --force

npm cache verify

运行结果如下 2024-08-06-20-06-28-image.png