标签:解决 基础 cap 令行 前言 准备 init 开发 安卓开发者
最近开始研究ionic,遵循网上教程进行一系列环境配置,本来以为so easy,结果碰的头破血流T^T,折腾了整整24个小时,总算顺利实现了项目的自动创建过程,
看到网上的确有好多人被这个过程坑的苦不堪言,所以我就来分享下实现方式
npm install -g ionic cordova项目创建:ionic start myApp,之后会生成一个叫做myApp的文件夹,里面会有项目的基础架构文件
项目启动:ionic serve,会直接打开相应的app页面,至此准备工作就完成啦
环境搭建是非常简单的事情,不过从在ionic start myApp的时候开始,出现了一系列的报警情况,接下去就说说2个最不好搞定的报警,及最终实现方式
Downloading:https://github.com/driftyco/ionic-app-base/archive/master.zipError Initializing app: Error: connect ETIMEDOUTnpm config set proxy=http://代理服务器ip:代理服务器端口,比如:npm config set proxy=http://192.168.1.1:8080npm config set registry "http://registry.npmjs.org/"Downloading: https://github.com/driftyco/ionic-app-base/archive/master.zip
Downloading: https://github.com/driftyco/ionic-starter-tabs/archive/master.zip
Installing npm packages (may take a minute or two)...Installing npm packages...
Error with start undefined
Error Initializing app: There was an error with the spawned command: npminstall
There was an error with the spawned command:
npminstallCaught exception:undefinedC:\Windows\System32\drivers\etc\host192.30.253.112 github.com //前面的地址由网站检测出
151.101.88.249 github.global.ssl.fastly.netping github.com,如果ping的通就对了,但是这种方法得到的结果与之前的一毛一样,卡在下面说的这个报警上npm install -g npm试了这么多,我想说的是:
所以现在肉戏来了,怎么解决呢?
ionic start myApp --skip-npm
cnpm install --savenpm install -g cnpm --registry=https://registry.npm.taobao.org
ionic serve

转自http://www.jianshu.com/p/f9b0dfe35328
另外添加3处链接 下载和参考
https://github.com/driftyco/ionic-app-base/archive/master.zip
https://github.com/driftyco/ionic-starter-tabs/archive/master.zip
http://www.cnblogs.com/nullman/p/5798730.html
http://www.runoob.com/ionic/ionic-install.html
标签:解决 基础 cap 令行 前言 准备 init 开发 安卓开发者
原文地址:http://www.cnblogs.com/callmeguxi/p/6604441.html