cordova - Phonegap 错误 + 错误 : Cannot find module 'q'

标签 cordova phonegap-build

尝试构建 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/

相关文章:

node.js - rodot-regular.ttf 的 pdf 生成器错误,我可以存储此 pdf

android - ionic : on-release event is triggered before releasing touch

ios - 我需要哪个证书来构建我使用 phonegap 创建的 ios 应用程序?

ios - 错误 ITMS-90085 : "No architectures in the binary. Lipo failed to detect any architectures in the bundle executable."

cordova - Phonegap 版本 : geofence custom plugin issue

iPhone UIWebview : How to force a numeric keyboard? 有可能吗?

android - Cordova 地理定位插件不起作用

file - Phonegap : Create a file in a specific folder

android - 从 cordova 中的 MediaType.ALLMEDIA 获取 "file:///storage"路径

android - 构建 Cordova PhoneGap 时出现 VM 错误