无法在Cordova项目中添加Android平台

时间:2017-01-03 19:50:55

标签: android cordova

这是我的命令行中显示的信息:

$ cordova platform add android
Error during untar for /home/aqib/.cordova/lib/npm_cache/cordova-android/5.2.2/package.tgz: 
Error: EPERM: operation not permitted, utime '/home/aqib/.cordova/lib/npm_cache/cordova-android/5.2.2/package/.npmignore'

Error: Failed to fetch platform android
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
Error: EPERM: operation not permitted, utime '/home/aqib/.cordova/lib/npm_cache/cordova-android/5.2.2/package/.npmignore'

1 个答案:

答案 0 :(得分:2)

您必须将平台安装为管理员

如果您使用Linux运行:

sudo cordova platform add android

如果您正在使用Windows,请右键单击cmd,然后选择以管理员身份运行。之后,您可以安装Cordova:

cordova platform add android