Ionic 填坑日记(一)

Ionic的环境安装中遇到的坑

Ionic开发环境搭建需要以下几步:

1.下载安装node.js(http://nodejs.org/

-安装完成后打开windows自带的Power Shell 命令行工具
-输入命令: node.js -v
查看node.js是否安装正确(这一步一般不会出错)

2.使用npm安装 ionic和cordova

-继续命令行输入npm install -g cordova ionic
-这时第一个坑就出现了。因为墙的原因一般下载安装会出错。翻墙也没用。

解决方法:

-连接到淘宝的镜像:npm install -g cnpm registry=https://registry.npm.taobao.org
-然后使用cnpm install -g cordova ionic安装
-使用命令 ionic -v 以及 cordova -v查询是否安装好了。

3.创建第一个HybirdApp

-命令ionic start myIonic blank来创建第一个App项目
-第二个坑出现了

Installing npm packages...
npm WARN deprecated gulp-minify-css@0.3.13: Please use gulp-clean-css
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update t
o graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "D:\\Program Files\\nodejs\\node.exe" "D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "ins
tall"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8

npm ERR! shasum check failed for C:\Users\lenovo\AppData\Local\Temp\npm-9064-eabb2097\registry.npmjs.org\bower\-\bower-1
.8.0.tgz
npm ERR! Expected: 55dbebef0ad9155382d9e9d3e497c1372345b44a
npm ERR! Actual:   469ffa306f25e8c5ede50608f8776eb6a2aabb7f
npm ERR! From:     https://registry.npmjs.org/bower/-/bower-1.8.0.tgz
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\lenovo\myIonic\npm-debug.log
Error with start undefined
Error Initializing app: There was an error with the spawned command: npminstall
There was an error with the spawned command: npminstall  
解决方法:这个问题还是网络引起的需要再次连接到淘宝镜像

-再次输入ionic start myIonic blank就OK 了(等的时间比较长)

Your Ionic app is ready to go!

Some helpful tips:

Run your app in the browser (great for initial development):
  ionic serve

Run on a device or simulator:
  ionic run ios[android,browser]

Test and share your app on device with Ionic View:
  http://view.ionic.io

Build better Enterprise apps with expert Ionic support:
  http://ionic.io/enterprise
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值