【发布时间】:2013-11-04 17:46:23
【问题描述】:
在我的 linux (ubuntu 12.04) 机器上构建 phonegap android 应用程序时出错。
我已经安装了 nodejs,将 JAVA_HOME、ANT_HOME、ANDROID_HOME vars 和 $JAVA_HOME/bin、$ANT_HOME/bin、$ANDROID_HOME/tools、$ANDROID_HOME/platform-tools 设置为路径。当我运行命令phonegap local build android 时,出现以下错误:
ME@My-PC:/dos/PhoneGap/HelloWorld$ phonegap local run android
[phonegap] compiling Android...
[error] An error occurred while building the android project.
module.js:340
throw err;
^
Error: Cannot find module 'shelljs'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/dos/PhoneGap/HelloWorld/platforms/android/cordova/lib/build.js:22:15)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
感谢您的帮助
【问题讨论】:
-
您是否运行
npm install phonegap来安装所有依赖项,例如shelljs? -
@MBillau 是的,我已经通过这个命令安装了 phonegap
-
你试过“$ phonegap build android”吗?当您尝试“$ phonegap local build android”时?
-
@Amit Gupta,我希望它在本地构建。
-
你的路径是什么?真的是
ME@My-PC:/dos/...吗?My-PC中的连字符可能有问题?我知道之前的空格和连字符存在问题...
标签: android linux node.js cordova