当前位置: 代码迷 >> Android >> cordova platform add android 海内慢
  详细解决方案

cordova platform add android 海内慢

热度:284   发布时间:2016-04-27 23:26:44.0
cordova platform add android 国内慢

Cordova报错:

?

E:\study\cordova\eppdemo>cordova platform add iosWARNING: Applications for platform ios can not be built on this OS - win32.npm http GET https://registry.npmjs.org/cordova-iosnpm http GET https://registry.npmjs.org/cordova-iosnpm http GET https://registry.npmjs.org/cordova-iosUnable to fetch platform ios: Error: connect ETIMEDOUT

?

?

解决方案:

? ?切换为国内npm源

? ??

http://npm.taobao.org/
$ npm install -g cnpm --registry=https://registry.npm.taobao.org
安装nrm
E:\study\cordova\eppdemo>nrm ls  npm ---- https://registry.npmjs.org/* cnpm --- http://r.cnpmjs.org/  taobao - http://registry.npm.taobao.org/  edunpm - http://registry.enpmjs.org/  eu ----- http://registry.npmjs.eu/  au ----- http://registry.npmjs.org.au/  sl ----- http://npm.strongloop.com/  nj ----- https://registry.nodejitsu.com/  pt ----- http://registry.npmjs.pt/E:\study\cordova\eppdemo>nrm use taobao   Registry has been set to: http://registry.npm.taobao.org/E:\study\cordova\eppdemo>nrm ls  npm ---- https://registry.npmjs.org/  cnpm --- http://r.cnpmjs.org/* taobao - http://registry.npm.taobao.org/  edunpm - http://registry.enpmjs.org/  eu ----- http://registry.npmjs.eu/  au ----- http://registry.npmjs.org.au/  sl ----- http://npm.strongloop.com/  nj ----- https://registry.nodejitsu.com/  pt ----- http://registry.npmjs.pt/
?

?

? ?成功:

E:\study\cordova\eppdemo>cordova platform add androidnpm http GET http://registry.npm.taobao.org/cordova-androidnpm http 200 http://registry.npm.taobao.org/cordova-androidnpm http GET http://registry.npm.taobao.org/cordova-androidnpm http 200 http://registry.npm.taobao.org/cordova-androidnpm http GET http://registry.npm.taobao.org/cordova-android/download/cordova-android-4.0.2.tgnpm http 200 http://registry.npm.taobao.org/cordova-android/download/cordova-android-4.0.2.tgAdding android project...Creating Cordova project for the Android platform:        Path: platforms\android        Package: com.deppon.epp        Name: HelloCordova        Activity: MainActivity        Android target: android-22Copying template files...Android project created with [email protected]Discovered plugin "cordova-plugin-whitelist" in config.xml. Installing to the projectFetching plugin "[email protected]" via npmnpm http GET http://registry.npm.taobao.org/cordova-plugin-whitelistnpm http 200 http://registry.npm.taobao.org/cordova-plugin-whitelistnpm http GET http://registry.npm.taobao.org/cordova-plugin-whitelist/download/cordova-plugin-st-1.0.0.tgznpm http 200 http://registry.npm.taobao.org/cordova-plugin-whitelist/download/cordova-plugin-st-1.0.0.tgzInstalling "cordova-plugin-whitelist" for androidE:\study\cordova\eppdemo>npm install -g ionic

?

?

?

  相关解决方案