简体   繁体   English

尝试安装 react-native 项目时出错

[英]Error when try to install react-native project

When I try to create new react-native project command: npx react-native init myproject当我尝试创建新的 react-native 项目命令时:npx react-native init myproject

I have follow errors:我有以下错误:

ERESOLVE overriding peer dependency ERESOLVE 覆盖对等依赖项
npm WARN While resolving: react-shallow-renderer@16.14.1 npm WARN 解析时:react-shallow-renderer@16.14.1
npm WARN Found: react@18.0.0发现 npm 警告:react@18.0.0
npm WARN node_modules/react npm WARN node_modules/react
npm WARN peer react@"18.0.0" from react-native@0.69.1 npm WARN peer react@"18.0.0" from react-native@0.69.1
npm WARN node_modules/react-native npm WARN node_modules/react-native
npm WARN react-native@"*" from the root project来自根项目的 npm WARN react-native@"*"
npm WARN 1 more (@react-native-community/cli) npm 警告 1 更多 (@react-native-community/cli)
npm WARN 1 more (use-sync-external-store) npm WARN 1 更多(使用同步外部存储)

要创建一个新的 react 应用程序,我通常使用npx create-react-app app-name for JS 和npx create-react-app app-name --template typescript以防你想在 TypeScript 中开发它

删除工作区中安装的全局 react-native 并重新安装:

  1. npm uninstall -g react-native-cli
  2. npm uninstall -g react-native
  3. npm install -g react-native
  4. npm upgrade -g

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM