Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

编译RN项目,依赖报错 #16606

Open
RiuHDuo opened this issue Sep 27, 2024 · 0 comments
Open

编译RN项目,依赖报错 #16606

RiuHDuo opened this issue Sep 27, 2024 · 0 comments
Labels
T-rn Target - 编译到 React Native V-4 Version - 4.x

Comments

@RiuHDuo
Copy link

RiuHDuo commented Sep 27, 2024

相关平台

微信小程序

小程序基础库: 1
使用框架: React

复现步骤

taro init
? 请选择框架 React
? 是否需要使用 TypeScript ? Yes
? 请选择 CSS 预处理器(Sass/Less/Stylus) Sass
? 请选择包管理工具 npm
? 请选择编译工具 Vite
? 请选择模板源 Github(最新)
✔ 拉取远程模板仓库成功!
? 请选择模板 react-NutUI(NutUI React 模板(https://nutui.jd.com/react/))
npm run dev:rn

期望结果

运行

实际结果

👽 Taro v4.0.6

Tips: 预览模式生成的文件较大,设置 NODE_ENV 为 production 可以开启压缩。
Example:
$ set NODE_ENV=production && taro build --type rn --watch

Installing React-Native related packages:
react@^18.2.0 react-dom@^18.2.0 react-native@^0.73.1 @react-native/metro-config@^0.73.2 expo@~50.0.2 @tarojs/taro-rn @tarojs/components-rn @tarojs/rn-runner @tarojs/rn-supporter @tarojs/runtime-rn
Error when detecting React-Native packages:
Error: Command failed: npm install "react@^18.2.0" "react-dom@^18.2.0" "react-native@^0.73.1" "@react-native/metro-config@^0.73.2" "expo@~50.0.2" "@tarojs/taro-rn" "@tarojs/components-rn" "@tarojs/rn-runner" "@tarojs/rn-supporter" "@tarojs/runtime-rn" --save
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/expo
npm ERR! expo@"~50.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer expo@">= 51" from @tarojs/[email protected]
npm ERR! node_modules/@tarojs/taro-rn
npm ERR! @tarojs/taro-rn@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!

环境信息

  Taro CLI 4.0.6 environment info:
    System:
      OS: Windows 11 10.0.22631
    Binaries:
      Node: 20.11.1 - C:\Program Files\nodejs\node.EXE
      Yarn: 4.5.0 - C:\Program Files\nodejs\yarn.CMD
      npm: 10.2.4 - C:\Program Files\nodejs\npm.CMD
    npmPackages:
      @tarojs/cli: 4.0.6 => 4.0.6 
      @tarojs/components: 4.0.6 => 4.0.6 
      @tarojs/helper: 4.0.6 => 4.0.6 
      @tarojs/plugin-framework-react: 4.0.6 => 4.0.6 
      @tarojs/plugin-html: 4.0.6 => 4.0.6 
      @tarojs/plugin-platform-alipay: 4.0.6 => 4.0.6 
      @tarojs/plugin-platform-h5: 4.0.6 => 4.0.6 
      @tarojs/plugin-platform-jd: 4.0.6 => 4.0.6 
      @tarojs/plugin-platform-qq: 4.0.6 => 4.0.6 
      @tarojs/plugin-platform-swan: 4.0.6 => 4.0.6 
      @tarojs/plugin-platform-tt: 4.0.6 => 4.0.6 
      @tarojs/plugin-platform-weapp: 4.0.6 => 4.0.6 
      @tarojs/react: 4.0.6 => 4.0.6 
      @tarojs/runtime: 4.0.6 => 4.0.6 
      @tarojs/shared: 4.0.6 => 4.0.6 
      @tarojs/taro: 4.0.6 => 4.0.6 
      @tarojs/vite-runner: 4.0.6 => 4.0.6 
      babel-preset-taro: 4.0.6 => 4.0.6 
      eslint-config-taro: 4.0.6 => 4.0.6 
      react: ^18.0.0 => 18.3.1 
This was referenced Sep 28, 2024
@koppthe koppthe added T-rn Target - 编译到 React Native V-4 Version - 4.x labels Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-rn Target - 编译到 React Native V-4 Version - 4.x
Projects
None yet
Development

No branches or pull requests

2 participants