在IONIC框架中添加联系人Cordova插件

时间:2015-05-25 08:08:40

标签: android cordova plugins ionic-framework ionic

这是一个IONIC项目。我尝试使用下一个命令行添加cordova contacts插件,但是我收到错误

cordova plugin add org.apache.cordova.contacts

结果错误:

Installing "org.apache.cordova.contacts" for android
Failed to install 'org.apache.cordova.contacts':Error: spawn EACCES
    at exports._errnoException (util.js:746:11)
    at ChildProcess.spawn (child_process.js:1162:11)
    at Object.exports.spawn (child_process.js:995:9)
    at Object.exports.spawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:100:31)
    at Object.exports.maybeSpawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:142:24)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:284:29
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:810:14
Error: spawn EACCES
    at exports._errnoException (util.js:746:11)
    at ChildProcess.spawn (child_process.js:1162:11)
    at Object.exports.spawn (child_process.js:995:9)
    at Object.exports.spawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:100:31)
    at Object.exports.maybeSpawn (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:142:24)
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:284:29
    at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
    at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:810:14

试图添加sms插件和同样的问题。

cordova plugin add https://github.com/cordova-sms/cordova-sms-plugin.git

我可以将其添加到其他项目中......

知道如何解决这个问题吗?

1 个答案:

答案 0 :(得分:1)

解决了! 这是一个许可问题。这是解决方案:

sudo chmod -R 777 projectFolder

-R:递归

希望这有帮助。