error [email protected]:The engine “node“ is incompatible with this module.Expected version “>=4 <=9“.

平时不太做nodejs项目,突然遇到一个编译需要用到yarn编译前端。

首先需要安装yarn

 npm install -g yarn

运行"yarn install"命令后,报错如下

yarn install v1.22.17
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...

error [email protected]: The engine "node" is incompatible with this module. Expected version ">=4 <=9". Got "14.15.1"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

使用如下命令解决

yarn config set ignore-engines true

接下来,重新“yarn install”可正确完成。

猜你喜欢

转载自blog.csdn.net/figosoar/article/details/121221670