[英]problem to create-react-app by using npx create-react-app my-app
[英]problem running create-react-app using npx
当我尝试使用命令npx create-react-app app
运行 create-react-app 时,我收到以下消息
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
并再次重新运行 npx 命令我仍然收到相同的消息,即我应该全局卸载 create-react-app ,即使是安装的唯一模块全局是 npm 在我的机器上
您首先需要卸载全局安装create-react-app
,然后使缓存无效。
相同的命令: npm uninstall -g create-react-app && npm cache clean -f
现在,您可以继续使用以下命令再次创建应用程序: npx create-react-app application-name
。
这个问题与这个问题类似。
全局卸载create-react-app后尝试npm cache clean --force命令。
希望以下代码可以工作:
npx create-react-app@latest my-app
问题(#10601): https://github.com/facebook/create-react-app/issues/10601
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.