在 Windows 10 上构建 React-Native 时出现编译错误

问题描述 投票:0回答:1

我正在尝试在 React Native 项目中执行以下脚本:

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res && cd android && ./gradlew clean assembleDebug

但是出现以下错误:

'.' is not recognized as an internal or external command, operable program or batch file.

我只能假设其中某个脚本正在 OSX/Linux 终端中运行,但我无法判断是哪个脚本以及如何修复它。 React Native 是否不支持在 Windows 上构建?

android react-native windows-10
1个回答
0
投票

根据@tomerpacific的评论,解决方案是将命令更改为

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res && cd android && gradlew clean assembleDebug

看起来

./command
不是有效的Powershell语法?关闭此问题已解决。

© www.soinside.com 2019 - 2024. All rights reserved.