提问者:小点点

使用npm或npx创建react app时出错


当我创建react应用程序时,出现了一个错误,屏幕截图是一个错误:

Node.js版本V12.18.1

npm版本V6.14.5

我正在使用以下命令创建一个项目:

  1. 我使用此npm安装-g create-react-app
  2. 全局添加了create-react-app
  3. 我使用以下命令创建了一个项目create-react-app demo

我还使用以下方法创建了一个项目

npx create-react-app demo

但我也犯了一个错误。 但是这个错误太长了,不能给这个问题添油加醋。 请给我一些解决这个问题的方法。 在那之前我无法继续工作。


共1个答案

匿名用户

在create-react-app文档中说:

如果您以前已经通过npm install-g create-react-app全局安装了create-react-app,我们建议您使用npm uninstall-g create-react-app卸载该软件包,以确保npx始终使用最新版本。

https://create-react-app.dev/docs/gett-started#quick-start

只需使用:NPX create-react-app Demo