【发布时间】:2020-10-19 10:09:59
【问题描述】:
$ yarn install
yarn install v1.19.1
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 cau
sed by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/5] Validating package.json...
error app@0.3.0: The engine "node" is incompatible with this module. Expected version ">=10.17.0". Got "10.15.2"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
在 react js 项目中安装 yarn 时出现错误
error app@0.3.0: The engine "node" is incompatible with this module. Expected version ">=10.17.0". Got "10.15.2"
error Found incompatible module.
【问题讨论】:
-
删除
package-lock.json或使用npm install -
关于第二个错误:在根目录中添加文件
.node-version,其中包括单行:v10.17.0。但首先你需要在本地机器上安装相同的节点版本。 -
@demkovych 我想在项目中安装 yarn。
-
然后删除
package-lock.json并运行yarn install --ignore-engines -
@demkovych 谢谢伙计,这是有效的。你能添加答案然后我可以投票给你的答案谢谢。
标签: node.js reactjs npm node-modules yarnpkg