首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用npx运行create-react-app时出现问题

使用npx运行create-react-app时出现问题
EN

Stack Overflow用户
提问于 2021-04-03 22:20:33
回答 3查看 56关注 0票数 0

当我尝试使用命令npx create-react-app app运行create-react-app时,我收到了以下消息

代码语言:javascript
复制
You are running `create-react-app` 4.0.1, which is behind the latest release (4.0.3).

We no longer support global installation of 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/

然后,我尝试使用npm uninstall -g create-react-app全局卸载create-react-app,并再次运行npx命令,我仍然收到相同的消息,即我应该全局卸载create-react-app,所以全局安装的唯一模块是我的机器上的npm

EN

回答 3

Stack Overflow用户

发布于 2021-04-03 22:28:19

您首先需要卸载全局安装的create-react-app,然后使缓存无效。

相同的命令:npm uninstall -g create-react-app && npm cache clean -f

现在,您可以使用npx create-react-app application-name继续创建应用程序。

这个问题类似于this one

票数 1
EN

Stack Overflow用户

发布于 2021-04-03 23:26:34

在全局卸载create-react-app之后尝试使用npm cache clean -force命令。

票数 0
EN

Stack Overflow用户

发布于 2021-12-15 12:03:52

希望下面的代码能正常工作:

npx create-react-app@latest my-app

问题(#10601):https://github.com/facebook/create-react-app/issues/10601

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66932193

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档