直接在目录下cmd然后create-react-app,报错:create-react-app创建项目失败的解决方法

解决方法,以管理员身份运行cmd,再create-react-app,不报错了,但是依旧有问题:

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.

可以看到create-react-app生成的目录是不完整的

create-react-app创建项目失败的解决方法

原因是create-react-app版本太旧。

解决方法:

删除旧版create-react-app,重新安装create-react-app,如下:

create-react-app创建项目失败的解决方法

create-react-app创建项目失败的解决方法

然后再用create-react-app新建项目就成功了:

create-react-app创建项目失败的解决方法create-react-app创建项目失败的解决方法

总结:想要create-react-app创建新项目,

①必须以管理员身份运行cmd

②create-react-app必须是新版,否则生成目录不完成,许需要卸载create-react-app后重装新版。

 

相关文章:

  • 2021-12-25
  • 2022-12-23
  • 2021-07-04
  • 2021-07-18
  • 2021-04-10
  • 2022-12-23
  • 2018-11-27
  • 2021-08-19
猜你喜欢
  • 2022-12-23
  • 2021-11-04
  • 2021-12-20
  • 2021-04-19
  • 2021-05-05
  • 2021-08-23
相关资源
相似解决方案