当前位置:   article > 正文

【开发问题解决】npx create-react-app 无法执行安装的问题处理_you are running `create-react-app` 4.0.1, which is

you are running `create-react-app` 4.0.1, which is behind the latest release

在使用npx create-react-app 命令,得到命令行反馈

You are running `create-react-app` 4.0.1, which is behind the latest release (4.0.2).

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/

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11

按照命令行提示执行npm uninstall -g create-react-app进行全局卸载后,再次执行安装依然报错,经过查询,发现需要清理一下npx的缓存,即执行全局卸载命令后,再运行一下命令

npx clear-npx-cache
  • 1

这时如果命令行提示

Need to install the following packages:
  clear-npx-cache
Ok to proceed? (y) 
  • 1
  • 2
  • 3

输入y继续安装clear-npx-cache的package包即可

然后再执行react的安装命令npx create-react-app 你的项目名称 即可顺利安装

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/码创造者/article/detail/1000296
推荐阅读
相关标签
  

闽ICP备14008679号