gpt4 book ai didi

node.js - Cordova:您可能没有运行此项目所需的环境或操作系统

转载 作者:IT老高 更新时间:2023-10-28 23:08:56 28 4
gpt4 key购买 nike

在 Linux Mint 17.1 x86_64 上,Cordova v4.3.0 出现此错误:

$ cordova run android

Running command: /home/naman/test/platforms/android/cordova/run
WARNING : No target specified, deploying to emulator
WARNING : no emulator specified, defaulting to Sample
Waiting for emulator...
Booting up emulator (this may take a while)....BOOT COMPLETE

/home/naman/test/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error: ENOENT, no such file or directory '/opt/software/android-sdk/tools/tools/lib/build.template'
at Object.fs.openSync (fs.js:432:18)
at Object.fs.readFileSync (fs.js:286:15)
at /home/naman/test/platforms/android/cordova/lib/build.js:129:40
at _fulfilled (/home/naman/test/platforms/android/cordova/node_modules/q/q.js:798:54)
at self.promiseDispatch.done (/home/naman/test/platforms/android/cordova/node_modules/q/q.js:827:30)
at Promise.promise.promiseDispatch (/home/naman/test/platforms/android/cordova/node_modules/q/q.js:760:13)
at /home/naman/test/platforms/android/cordova/node_modules/q/q.js:574:44
at flush (/home/naman/test/platforms/android/cordova/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:415:13)
ERROR running one or more of the platforms: Error: /home/naman/test/platforms/android/cordova/run: Command failed with exit code 8
You may not have the required environment or OS to run this project

PATH 变量好像没问题(SDK 的路径是正确的):

$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/software/android-sdk/tools:/opt/software/android-sdk/platform-tools

我使用安装它:

sudo apt-add-repository ppa:cordova-ubuntu/ppa
sudo apt-get update
sudo apt-get install cordova-cli
npm install -g cordova

安装顺利,项目创建没有任何错误。我是否缺少一些依赖项?

最佳答案

您可能需要卸载设备上的现有应用。

我从另一台计算机在该设备上安装了我的应用程序。当我运行 cordova run android 我得到

您可能没有运行此项目所需的环境或操作系统

但是当我尝试通过 adb 安装我的 apk 时,它告诉我该应用程序已经安装。所以我把它卸载了。

关于node.js - Cordova:您可能没有运行此项目所需的环境或操作系统,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29721410/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com