美文网首页react-native
[ReactNative]--init新项目时error esl

[ReactNative]--init新项目时error esl

作者: Alex_LoveYing | 来源:发表于2019-07-05 14:25 被阅读0次

ReactNative init新项目时error eslint@6.0.1: The engine "node" is incompatible with this module. Expected version "^8.10.0 || ^10.13.0 || >=11.10.1". Got "11.2.0"。

这是node版本不兼容导致的,升级node版本可以解决,不升级也可以解决,用下面的命令:

npx create-react-app my-app  --use-npm

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

上面这是使用 n 来安装最新的稳定版的nodejs。
n 是一个Node工具包,它提供了几个升级命令参数:

n 显示已安装的Node版本
n latest 安装最新版本Node
n stable 安装最新稳定版Node
n lts 安装最新长期维护版(lts)Node
n <version> 根据提供的版本号安装Node

比如,你想安装指定的版本号:

sudo n 0.8.21

一旦安装完成,你可以通过下面的命令确认安装的版本:

node -v

相关文章

网友评论

    本文标题:[ReactNative]--init新项目时error esl

    本文链接:https://www.haomeiwen.com/subject/qwxehctx.html