react创建项目报错
本文最后更新于:3 年前
前言
这篇文章主要介绍
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
运行成功
本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!