create-react-app 初始化项目的时候报错,解决方案

181 阅读1分钟

image.png

  1. 首先我们查看以下自己的node和npm版本,升级到最新的,
  2. 然后查看以下自己的react版本是不是新的
  3. 然后还是会出错的话,我们可以卸载 :
$ npm uninstall -g create-react-app // 全局卸载
$ npm uninstall create-react-app // 卸载

初始化项目

  npx create-react-app project-app

升级下 npm的等级,

$ npm install npm@latest -g

关键的地方

nrm ls 查看以下自己的源 , nrm use 源名字 来切换到源 然后在创建项目

有的时候可以是源的问题

image.png