我尝试使用 ' 添加 Android 平台ionic platform add android
' 并且它给出了以下错误:
> 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>
有什么问题吗?
我认为你的 cordova npm 包错过了一些模块。
尝试以下方法重新安装它:
npm uninstall cordova -g && npm install -g cordova
我使用的是 5.0 版本,它工作正常,如果上面不起作用,请尝试以下操作:
npm uninstall cordova -g && npm install -g [email protected] /cdn-cgi/l/email-protection
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)