在 react js 项目中安装纱线时出错

getting error while installing the yarn in react js project

$ 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 和 运行 yarn install --ignore-engines

在团队中工作时,有时另一个开发人员会安装它。避免这种情况发生的一种好方法是使用我写的 package-locks-checks

如果你 运行 npx package-locks-checks 它会检查这种不一致并避免你在生产环境中遇到问题。