NodeJS 错误:命令失败:adb shell am start -n .MainActivity

suzh9iv8  于 9个月前  发布在  Node.js
关注(0)|答案(1)|浏览(111)

目前,我正在尝试使用react-native run-android在本地设备上运行我的react native应用程序。但我收到以下错误:-
信息连接到开发服务器.警告无法使用“adb reverse”连接到开发服务器:spawnSync adb ENOENT信息启动应用程序.“adb”无法识别为内部或外部命令、可操作程序或批处理文件。错误无法启动应用程序。错误:命令失败:adb shell am start -n com.tna/com.tna.MainActivity at makeError(C:\Users\deepali\Desktop\Jay\TNA-1-master\node_modules\execa\index.js:174:9)at Function.module.exports.sync(C:\Users\deepali\Desktop\Jay\TNA-1-master\node_modules\execa\index.js:338:15)at tryLaunchAppOnDevice(C:\Users\deepali\Desktop\Jay\TNA-1-master\node_modules@react-native-community\cli-platform-android\build\commands\runAndroid\tryLaunchAppOnDevice.js:58:22)at C:\Users\deepali\Desktop\Jay\TNA-1-master\node_modules@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:104:39 at Array.forEach()at runOnAllDevices(C:\Users\deepali\Desktop\Jay\TNA-1-master\node_modules@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:102:48)at processTicksAndRejections(internal/process/task_queues.js:93:5)at processc Command. JAPONSE Action(C:\Users\deepali\Desktop\Jay\TNA-1-master\node_modules@react-native-community\jupload\build\index.js:186:9)info使用--verbose标志运行CLI以了解更多详细信息。
我当前的节点版本是12.14.0

im9ewurl

im9ewurl1#

我也遇到了同样的问题,我先写了:source /home/username/.bash_profile
在bash_profile中,我有ANDROID_HOME和PATH。
然后,我执行npm start,它可以正常工作。

相关问题