Skip to content

Commit 66cef71

Browse files
namehuhuxiangSingle-Dancer
authored
fix(rn-runner): 为 spawn 启用 shell (#18478)
问题: 在 Windows(PowerShell/CMD)环境中, rn-runner 通过 child_process.spawn 启动 metro/打包时未启用 shell, 可能导致命令解析或路径解析失败,出现开发服务器或打包无法启动的问题。 解决: 在 src/index.ts 的两处 spawn 调用设置 { stdio: 'inherit', shell: true } 影响范围: 全平台:Wind、MacOS测试通过 验证: 在 Windows 环境验证 RN 开发与打包流程可正常运行,日志输出符合预期。 Closes #18180, #17744, #16938 Co-authored-by: huxiang <xiang.hu@weimob.com> Co-authored-by: vasily <chenchiajun@gmail.com>
1 parent 7420fda commit 66cef71

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/taro-rn-runner/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export default async function build (_appPath: string, config: any): Promise<any
6767
'--custom-log-reporter-path',
6868
'@tarojs/rn-supporter/TerminalReporter'
6969
].concat(cliParams), {
70-
stdio: 'inherit'
70+
stdio: 'inherit', shell: true
7171
})
7272
if (config.qr) {
7373
previewDev({
@@ -115,7 +115,7 @@ export default async function build (_appPath: string, config: any): Promise<any
115115
'--entry-file',
116116
'index.js'
117117
].concat(cliParams), {
118-
stdio: 'inherit'
118+
stdio: 'inherit', shell: true
119119
})
120120
if (config.qr) {
121121
process.on('beforeExit', () => {

0 commit comments

Comments
 (0)