create-react-app脚手架卸载重装以及初始化项目中的问题

443 阅读1分钟

1.破解立新

新版本的react不需要本地global安装create-react-app然后创建项目了,如果之前安装过,那么需要卸载掉。

🌵卸载过程:

  1. 卸载老版本create-react-app

    npm uninstall -g create-react-app
    
  2. 检查是否卸载成功

    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 (这时这里没有版本号显示)
    
  3. 创建新工程

    npx create-react-app 01_react