2022-07-26 初始化react-native项目时报错Error: Command failed: yarn add react-native --exact

前言:打算整个新的rn(react-native)项目来测试,故此 npx react-native init myapp ,没想到报了个错误,具体如下:

Error: Command failed: yarn add react-native --exact  // 错误:命令失败:纱线添加反应本机--精确

除此之外还有一行:

The engine "node" is incompatible with this module. Expected version ">=14". Got "12.18.2" // 引擎“节点”与此模块不兼容。预期版本“>=14”。获得“12.18.2”

意思就是,你现在开发环境下的node版本太低了,达不到要求,至少要达到14版本,而我现在的node版本是12。

废话不多说,直接升级node。

posted @ 2022-07-26 23:34  叶乘风  阅读(813)  评论(0编辑  收藏  举报