error eslint@6.1.0: The engine "node" is incompatible with this module.

create-react-app新建项目时遇到的问题:

error eslint@6.1.0: The engine "node" is incompatible with this module. Expected version "^8.10.0 || ^10.13.0 || >=11.12.0". 
Got "10.10.0"
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.复制代码

问题的缘由是node版本不兼容致使的,须要升级node版本,也能够不升级用npx命令解决:node

用npx命令解决的方法:react

$ npx create-react-app demo-app --use-npm复制代码

升级node版本(Mac):

一、查看本机node版本:npm

$ node -v复制代码

二、清除node的cachebash

$ sudo npm cache clean -f复制代码

三、安装 n 工具,n工具是用来管理node.js版本的
app

$ sudo npm install -g n复制代码

四、安装最新版的node工具

$ sudo n stable复制代码

五、更新npm版本this

$ sudo npm install npm@latest -g复制代码

六、而后查看本机的node版本和npm版本spa

$ node -v
$ npm -v复制代码


七、建立react新项目:eslint

$ create-react-app demo-app复制代码
相关文章
相关标签/搜索