在使用create-react-app创建项目时,控制台爆出这个
A template was not provided. This is likely because you're using an outdated version of create-react-app.
Please note that global installs of create-react-app are no longer supported.
解决方案:
1、卸载老版本
npm uninstall -g create-react-app
记得查看下是否卸载成功
which create-react-app // 查看create-react-app 在哪个位置
如果你像我一样提示 (/usr/local/bin/create-react-app)
请运行rm -rf /usr/local/bin/create-react-app
以删除此
2、安装新版本
npm install -g create-react-app
注:如果重新安装react 脚手架时报如下错误
bash: create-react-app: command not found
可以使用如下命令创建脚手架
npx create-react-app my-app