reactjs - 使用 npx 运行 create-react-app 的问题
问题描述
当我尝试使用命令运行 create-react-app 时,npx create-react-app 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/
然后,我尝试使用全局卸载 create-react-appnpm 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
。
这个问题与这个问题类似。
推荐阅读
- selenium - 如何使用 Selenium 从父节点中提取文本,不包括子节点中的文本
- javascript - 数据保存到事件我得到 Push key 。但是 Event_key 分配 EventList { ref : Event_key } Firebase 实时数据库时出现问题
- android - android.view.InflateException: Binary XML file line #17: Binary XML file line #17: Error inflating class
- google-admin-sdk - G Suite:自动将子组织单位中的用户添加到组
- c++ - C++ 正确使用 cout wcout ifstream 读取带有重音字符的文本文件
- python - 无法导入 utils.programs 但成功导入 utils - python3 导入错误
- react-router-dom - react-router-dom 在多个 / in url 上给出 404
- c++ - Magick++/NAPI 模块内存泄漏
- html - CSS:旋转 90 度导航并坚持到左上角
- reactjs - React - 应用程序自定义路由在发布模式下不起作用