1.破解立新
新版本的react不需要本地global安装create-react-app然后创建项目了,如果之前安装过,那么需要卸载掉。
🌵卸载过程:
-
卸载老版本create-react-app
npm uninstall -g create-react-app
-
检查是否卸载成功
1.执行命令 create-react-app --version 显示出版本号,则说明没有删除 create-react-app 2.继续执行 which create-react-app 出现类似 /usr/local/bin/create-react-app 3.执行 rm -rf /usr/local/bin/create-react-app 删除create-react-app 4.继续执行 create-react-app --version (这时这里没有版本号显示)
-
创建新工程
npx create-react-app 01_react