[英]The engine "node" is incompatible with this module. Expected version "7.5.0". Got "15.13.0"
one of my friends sent me a project using react and node and i tried to run it with yarn.我的一个朋友给我发了一个使用 react 和 node 的项目,我尝试用 yarn 运行它。 Each time i run this command i got this error: The engine "node" is incompatible with this module.每次运行此命令时,我都会收到此错误:引擎“节点”与此模块不兼容。 Expected version "7.5.0".预期版本“7.5.0”。 Got "15.13.0".得到“15.13.0”。 I just want to know how update the react version of a project我只想知道如何更新项目的反应版本
Have a good day祝你有美好的一天
You could use this npm package , but be aware of breaking changes especially as it seems to be a very old version.您可以使用此 npm package ,但请注意重大更改,尤其是因为它似乎是一个非常旧的版本。
A better approach may be to use nvm - node version manager (or nvm-windows if that is your operating system) to install and use an older - compatible version of node, eg v7.5.0.更好的方法可能是使用nvm -节点版本管理器(或nvm-windows ,如果那是您的操作系统)来安装和使用较旧的节点兼容版本,例如 v7.5.0。
You can change your package.json您可以更改您的 package.json
"engines": { "node": ">=7.5.0"},
This will make the projects run with node 7.5.0 or newer versions.这将使项目使用节点 7.5.0 或更高版本运行。 Also using nvm也使用 nvm
nvm install version_you_want
nvm use version_you_want
Check node and npm versions检查节点和 npm 版本
node -v
npm -v
Other option is to use其他选择是使用
yarn install --ignore-engines纱线安装--忽略引擎
See this post: How to fix engine "node" version?看到这篇文章: 如何修复引擎“节点”版本?
In my case I was gettin the same error because I didn't set the.env file就我而言,我遇到了同样的错误,因为我没有设置 .env 文件
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.