离子运行android - 权限问题

时间:2017-03-31 20:59:04

标签: android ionic-framework

我遇到麻烦来运行命令ionic run android(我使用Ionic 2)。当我在项目文件夹中运行它时,我收到以下错误:

shell.js:内部错误

Error: EPERM: operation not permitted, chmod '/home/ronanlopes/workspace/hbesco_app/platforms/android/res/xml/config.xml'
    at Error (native)
    at Object.fs.chmodSync (fs.js:1168:18)
    at copyFileSync (/home/ronanlopes/workspace/hbesco_app/platforms/android/cordova/node_modules/shelljs/src/cp.js:41:6)
    at /home/ronanlopes/workspace/hbesco_app/platforms/android/cordova/node_modules/shelljs/src/cp.js:201:5
    at Array.forEach (native)
    at Object._cp (/home/ronanlopes/workspace/hbesco_app/platforms/android/cordova/node_modules/shelljs/src/cp.js:157:11)
    at Object.cp (/home/ronanlopes/workspace/hbesco_app/platforms/android/cordova/node_modules/shelljs/src/common.js:186:23)
    at updateConfigFilesFrom (/home/ronanlopes/workspace/hbesco_app/platforms/android/cordova/lib/prepare.js:97:11)
    at Api.module.exports.prepare (/home/ronanlopes/workspace/hbesco_app/platforms/android/cordova/lib/prepare.js:40:20)
    at Api.prepare (/home/ronanlopes/workspace/hbesco_app/platforms/android/cordova/Api.js:195:45)

如果我使用sudo运行命令,它会给我一个错误,即找不到ANDROID_HOME(我检查了它并导出了它)。 任何想法如何解决它?感谢

1 个答案:

答案 0 :(得分:1)

试 sudo -E ionic run android

而不是sudo ionic run android

它会起作用