react创建项目报错

前言
这篇文章主要介绍
react创建项目时出现error Found incompatible module.
开发环境:macOS
node版本:11.8.0


创建项目

运行命令

1
npx create-react-app reactGobang

发现提示报错了
1
2
3
github npx create-react-app reactGobang
Could not create a project called "reactGobang" because of npm naming restrictions:
* name can no longer contain capital letters

分析原因

发现是说不支持大写的原因
修改命令重新执行

1
npx create-react-app react_gobang

发现提示又报错了

1
2
3
4
5
[2/4] 🚚  Fetching packages...
error eslint@6.6.0: The engine "node" is incompatible with this module. Expected
version "^8.10.0 || ^10.13.0 || >=11.10.1". Got "11.8.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

分析原因2

发现是说node版本没有符合^8.10.0 || ^10.13.0 || >=11.10.1这个范围内。我本地的node版本是11.8.0

解决方法

输入npx create-react-app react_gobang --use-npm

运行成功



react创建项目报错
作者
墨陌默
发布于
2019年11月12日
许可协议