You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

React Native打包报错:id参数需为字符串,请求协助解决

问题求助:执行BUNDLE打包时参数错误及CLI包未识别问题

执行BUNDLE ./index.js时触发错误:

index.js: "id"参数必须为字符串类型,接收到undefined

已安装@react-native-community/cli,但npx react-native-info输出显示该包未找到,已尝试facebook/react-native#34315中的所有解决方案,仍无法解决,请求协助。

环境信息(npx react-native-info 输出)

系统

  • 操作系统: macOS 13.1
  • CPU: (8) arm64 Apple M1
  • 内存: 83.02 MB / 8.00 GB
  • Shell:
    • 版本: 5.8.1
    • 路径: /bin/zsh

二进制工具

  • Node:
    • 版本: 18.16.1
    • 路径: /usr/local/bin/node
  • Yarn:
    • 版本: 1.22.19
    • 路径: /opt/homebrew/bin/yarn
  • npm:
    • 版本: 9.5.1
    • 路径: /usr/local/bin/npm
  • Watchman:
    • 版本: 2023.07.10.00
    • 路径: /opt/homebrew/bin/watchman

包管理器

  • CocoaPods:
    • 版本: 1.12.1
    • 路径: /usr/local/bin/pod

SDK

  • iOS SDK:
    • 支持平台:
      • DriverKit 22.4
      • iOS 16.4
      • macOS 13.3
      • tvOS 16.4
      • watchOS 9.4
  • Android SDK: 未找到

集成开发环境

  • Android Studio: 2022.2 AI-222.4459.24.2221.10121639
  • Xcode:
    • 版本: 14.3.1/14E300c
    • 路径: /usr/bin/xcodebuild

编程语言

  • Java: 未找到
  • Ruby:
    • 版本: 2.6.10
    • 路径: /usr/bin/ruby

npm本地包

  • @react-native-community/cli: 未找到
  • react:
    • 已安装版本: 18.2.0
    • 期望版本: 18.2.0
  • react-native:
    • 已安装版本: 0.72.3
    • 期望版本: 0.72.3
  • react-native-macos: 未找到

npm全局包

  • react-native: 未找到

项目配置

  • Android配置:
    • hermesEnabled: true
    • newArchEnabled: false
  • iOS配置:
    • hermesEnabled: true
    • newArchEnabled: false

内容的提问来源于stack exchange,提问作者Prisha

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.14 12:20:57