简体   繁体   English

create-react-app 自版本 4.0.1 起不起作用如何删除旧版本并安装它的新版本

[英]create-react-app is not working since version 4.0.1 how to remove the old version and install the new version of it

When I enter npx create-react-app./ command for creating a react app it gives the following warning and not creating the app当我输入npx create-react-app./命令来创建反应应用程序时,它会给出以下警告,而不是创建应用程序

Please remove any global installs with one of the following commands:
- npm uninstall -g create-react-app
- yarn global remove create-react-app

The latest instructions for creating a new app can be found here:
https://create-react-app.dev/docs/getting-started/

When I enter - npm uninstall -g create-react-app command, and then I entered gain npx create-react-app./ again gives the above error当我输入- npm uninstall -g create-react-app命令,然后我输入 gain npx create-react-app./再次出现上述错误

Updated更新

I uninstalled with npm uninstall -g create-react-app我用npm uninstall -g create-react-app
and again installed with npm install -g create-react-app并再次安装npm install -g create-react-app
and then created my app with npx create-react-app./ I already created a folder inside that folder I created my project so no need to gave project name I used ./ it will create your project inside that folder然后npx create-react-app./ app 创建了我的应用程序。/我已经在该文件夹中创建了一个文件夹我创建了我的项目,因此无需提供我使用的项目名称./它将在该文件夹中创建你的项目

I uninstalled with npm uninstall -g create-react-app我用npm uninstall -g create-react-app
and again installed with npm install -g create-react-app并再次安装npm install -g create-react-app
and then created my app with npx create-react-app./ I already created a folder inside that folder I created my project so no need to gave project name I used ./ it will create your project inside that folder然后npx create-react-app./ app 创建了我的应用程序。/我已经在该文件夹中创建了一个文件夹我创建了我的项目,因此无需提供我使用的项目名称./它将在该文件夹中创建你的项目

You could try the following:您可以尝试以下方法:

Uninstall with npm uninstall -g create-react-app使用npm uninstall -g create-react-app

Install with npm install -g create-react-app and try again使用npm install -g create-react-app安装并重试

You could also try using npm init : npm init react-app myapp您也可以尝试使用npm initnpm init react-app myapp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM