[英]Installation of Cordova on Ubuntu gives "…cordova/node_modules/q/q.js:126: error
I am installing Cordova on Ubuntu and followed these instruction on Cordova site: 我在Ubuntu上安装Cordova,并按照Cordova网站上的这些说明进行操作:
All is well until I come to this step: 一切顺利,直到我执行此步骤:
cordova emulate android
I get the following error: 我收到以下错误:
Running command: /home/eisen/android/hello/platforms/android/cordova/run --emulator
ANDROID_HOME=/home/eisen/android/android-sdk-linux
JAVA_HOME=/usr/lib/jvm/java-8-oracle
/home/eisen/android/hello/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error executing "adb devices": /home/eisen/android/android-sdk-linux/platform-tools/adb: 1: /home/eisen/android/android-sdk-linux/platform-tools/adb: Syntax error: ")" unexpected
Error: /home/eisen/android/hello/platforms/android/cordova/run: Command failed with exit code 1
This error is discussed elsewhere and always refers to correcting the PATH and ANDROID_HOME variables. 该错误在其他地方讨论,并且始终指的是更正PATH和ANDROID_HOME变量。 That has not helped me. 那没有帮助我。 Here are my settings of these variables: 这是我对这些变量的设置:
ANDROID_HOME=/home/eisen/android/android-sdk-linux
ANDROID_SDK=/home/eisen/android/android-sdk-linux
PATH=...:/home/eisen/android/android-sdk-linux:/home/eisen/android/android-sdk-linux/tools:/home/eisen/android/android-sdk-linux/platform-tools
The ... in the PATH refers to other directories which are not relevant to the question. PATH中的...表示与问题无关的其他目录。
... ...
通过安装未在安装过程中记录的android-tools-adb,我能够解决该错误:
sudo apt-get install android-tools-adb
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.