尝试构建 phonegap 应用程序,但出现奇怪的错误:-
user@ubuntu:~/Projects/PhoneGap/testapp$ phonegap build android
[phonegap] executing 'cordova build android'...
Running command: /home/user/Projects/PhoneGap/testapp/platforms/android/cordova/build
module.js:338
throw err;
^
Error: Cannot find module 'q'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/home/user/Projects/PhoneGap/testapp/platforms/android/cordova/lib/spawn.js:23:15)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
You may not have the required environment or OS to build this project
Cordova -v => 5.3.3
想要:{“节点”:“0.8.x || 0.10.x”}(当前:{“节点”:“0.12.7”,“npm”:“2.11.3”}
请提出一些建议..谢谢
最佳答案
我在同样的问题上苦苦挣扎,终于弄清楚 npm install q --save
帮我。
关于cordova - Phonegap 错误 + 错误 : Cannot find module 'q' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33442714/