javascript - 如何使用最新的react版本(react18)?

标签 javascript reactjs react-native react-hooks frontend

使用 npx create-react-app my-app 时,出现此错误:

You are running create-react-app 4.0.3, which is behind the latest release (5.0.1). 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

我使用了命令 npm uninstall 并查看了 getting started with react

但该链接暗示了相同的过程 npx create-react-app my-app.我也使用了这个命令npm install React React-dom但是这个
只安装一个节点模块和一个package.json。它不会创建通常的 react 样板 和所有。大家有什么想法,请帮忙。

最佳答案

尝试这个解决方案:

npx create-react-app@latest myApp

关于javascript - 如何使用最新的react版本(react18)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71904638/

相关文章:

javascript - 如果没有值显示默认日期 - 日期选择器 - ReactJs

ios - 条目, ":CFBundleIdentifier",不存在

ios - React native 无法从中解析模块 ./flux.png

react-native - 在 subview 中水平滚动时,如何防止父 Flatlist 的垂直滚动?

javascript - 无法使用 jQuery 更改背景颜色

javascript - transitionConfig 在 native react 中不起作用

node.js - 如何在 npm 脚本中使用环境变量

javascript - Vue 集中滚动和调整大小事件(避免组件重复)

javascript - 如何在 RegExp 中创建 OR 条件?

javascript - 根据 slider 值显示和隐藏元素