今天使用create-react-app去创建项目时,当输入
npx create-react-app react_hooks
控制台报错
You are running `create-react-app` 5.0.1, which is behind the latest release (5.1.0).
We recommend always using the latest version of create-react-app if possible.
The latest instructions for creating a new app can be found here:
检查我们的npm版本
npm -v
8.5.0
得到的解决办法是
当npm版本大于5.2 使用npx create-react-app@latest my-app
结果发现还是同样的错误
最后重新全局安装了create-react-app
npm install -g create-react-app
然后重新执行创建命令就可以了