0

我正在尝试运行create-react-app,但它似乎没有按预期的方式运行。我正在尝试以下命令:

  1. create-react-app my-app
  2. cd my-app
  3. npm start

并在尝试运行时出现以下错误,如果您能提供帮助,将在此处输入图像描述会很棒

4

3 回答 3

1

请全局删除create-react-app试试这个npm remove -g create-react-app

然后只需运行这些命令

npx create-react-app my-app
cd my-app
npm start

来源:https ://reactjs.org/docs/create-a-new-react-app.html

于 2019-12-11T05:55:31.713 回答
1

你分享的日志说,创建不成功,你使用的create-react-app版本很旧。

更好地使用npx它将确保您在没有任何全局安装的情况下即时使用最新版本。试试下面的命令

$ npx create-react-app festudents
于 2019-12-11T05:46:48.150 回答
0

尝试删除 creat-react-app 样板,然后使用以下命令创建一个新样板

npx create-react-app my-app 2
于 2019-12-11T05:42:45.560 回答