reactnativecn / react-native-pushy

React Native 极速热更新服务
https://pushy.reactnative.cn
Other
1.77k stars 257 forks source link

pushy bundle --platform android 失败 报错 **_Unknown or unexpected option: --assets-dest_** #427

Closed VitaminC1989 closed 3 weeks ago

VitaminC1989 commented 6 months ago

我的RN项目只用支持安卓 且已按照文档要求进行了配置 请问怎么解决这个问题

环境信息:

MacOS:12.5.1 react-native: 0.71.7 react-native-update-cli: 1.18.0 react-native-update: 10.0.0

报错信息如下:

pushy bundle --platform android Bundling with react-native: 0.71.7 react-native-update-cli: 1.18.0 react-native-update: 10.0.0 Running bundle command: node /Users/chenyuqiao/Desktop/YHProject/MaintenancePatrolMobile/node_modules/@expo/cli/build/bin/cli export:embed --assets-dest .pushy/intermedia/android --bundle-output .pushy/intermedia/android/index.bundlejs --dev false --entry-file index.js --platform android --reset-cache Unknown or unexpected option: --assets-dest Error: "react-native bundle" command exited with code 1. at ChildProcess. (/Users/chenyuqiao/.nvm/versions/node/v18.18.2/lib/node_modules/react-native-update-cli/lib/bundle.js:93:16) at ChildProcess.emit (node:events:517:28) at maybeClose (node:internal/child_process:1098:16) at ChildProcess._handle.onexit (node:internal/child_process:303:5)

Unknown or unexpected option: --assets-dest

sunnylqm commented 6 months ago

请更新update-cli到最新版本

LiZhequ commented 3 weeks ago

请更新update-cli到最新版本

windows下面依旧会有这个问题,看了下 const bundleCommand = cliPath.includes('@expo/cli') ? 'export:embed' : 'bundle'; cliPath在windows下是 "node_modules\@expo\cli\build\bin\cli",bundleCommand会是bundle导致错误

sunnylqm commented 3 weeks ago

cliPath.includes('@expo/cli') || cliPath.includes('@expo\\cli') 这样可行吗?

请更新update-cli到最新版本

windows下面依旧会有这个问题,看了下 const bundleCommand = cliPath.includes('@expo/cli') ? 'export:embed' : 'bundle'; cliPath在windows下是 "node_modules\@expo\cli\build\bin\cli",bundleCommand会是bundle导致错误

LiZhequ commented 3 weeks ago

cliPath.includes('@expo/cli') || cliPath.includes('@expo\\cli') 这样可行吗?

请更新update-cli到最新版本

windows下面依旧会有这个问题,看了下 const bundleCommand = cliPath.includes('@expo/cli') ? 'export:embed' : 'bundle'; cliPath在windows下是 "node_modules@expo\cli\build\bin\cli",bundleCommand会是bundle导致错误

可行,我在自己的电脑上就是临时这么改的,另外,expo-router的entryFile应该是./node_modules/expo-router/entry.js,目前使用expo的话要手动指定--entryFile才能正确运行,expo碰到的就这两个问题

sunnylqm commented 3 weeks ago

自己在项目目录下建个index.js

import 'expo-router/entry.js'

就不需要再手动指定了

之所以这里没改,是不知道哪天哪个框架又魔改入口

sunnylqm commented 3 weeks ago

已发布1.28.0