离子CLI无法添加Android平台 [英] IONIC CLI could not add Platform Android

查看:148
本文介绍了离子CLI无法添加Android平台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图添加与Android平台的离子平台的android添加,它给了以下错误:

I tried to add Android platform with 'ionic platform add android' and it gave the following error:

> C:\Users\---\Desktop\Tst\Test>ionic platform add android
>     Updated the hooks directory to have execute permissions
>     Downloading Default Ionic Resources
>     Downloading: https://github.com/driftyco/ionic-default-resources/archive/master.zip
>     [=============================]  100%  0.0s
>     Done adding default Ionic resources
>     Adding icons for platform: android
>     Error: Cannot find module 'config-chain'
>         at Function.Module._resolveFilename (module.js:337:15)
>         at Function.Module._load (module.js:287:25)
>         at Module.require (module.js:366:17)
>         at require (module.js:385:17)
>         at Object.<anonymous> (C:\Users\---\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\npmconf\npmconf.js:2:10)
>         at Module._compile (module.js:435:26)
>         at Object.Module._extensions..js (module.js:442:10)
>         at Module.load (module.js:356:32)
>         at Function.Module._load (module.js:311:12)
>         at Module.require (module.js:366:17)
>         at require (module.js:385:17)
>     
>     C:\Users\---\Desktop\Tst\Test>

什么是错呢?

推荐答案

我觉得你科尔多瓦NPM包已经错过了一些模块。
试试这个重新安装它:

I think your cordova npm package has been missed some modules. Try this to re-install it:

npm uninstall cordova -g && npm install -g cordova

我使用的是5.0版,它工作正常,如果上面没有工作,试试这个:

I'm using version 5.0 and it works fine, if above not works, try this:

npm uninstall cordova -g && npm install -g cordova@5.0

这篇关于离子CLI无法添加Android平台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆