Weex框架开发 基于windows系统的环境搭建

1 安装依赖node.js

1.1 node 版本

C:\Users\**>node -v
v10.15.1

1.2 npm包管理工具版本(当前,node会同时安装npm)

C:\Users\**>npm -v
6.4.1

1.3 安装week-toolkit

C:\Users\**>npm install -g weex-toolkit

WINDOWS下安装weex-toolkit会出现以下警告: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\weex-toolkit\node_modules\xtoolkit\node_modules\fsevents)

weex -v查看安装weex版本:(此处需参考文章结尾的注意事项)

C:\Users\**>weex -v
? May weex-toolkit anonymously report usage statistics to improve the tool over time? No
? Which npm registry you perfer to use? npm
11:34:05 : Set telemetry => false
11:34:05 : Set registry => http://registry.npmjs.org
Set telemetry = false
Set registry = "http://registry.npmjs.org"
11:34:05 : You can config this configuration again by using `weex config [key] [value]`
11:34:05 : Enjoying your coding time!

   v1.3.11
 - weex-builder : v0.4.0
 - weex-previewer : v1.5.1

1.4 weex init project

小技巧:window下快速切换盘符路径(cd /d P:\weex-project)

>weex init projectname

>..\\\\\

>

Success! Created day01 at P:\weex-project\day01

Inside that directory, you can run several commands:


  npm start
  Starts the development server for you to preview your weex page on browser
  You can also scan the QR code using weex playground to preview weex page on native

  npm run dev
  Open the code compilation task in watch mode

  npm run ios
  (Mac only, requires Xcode)
  Starts the development server and loads your app in an iOS simulator

  npm run android
  (Requires Android build tools)
  Starts the development server and loads your app on a connected Android device or emulator

  npm run pack:ios
  (Mac only, requires Xcode)
  Packaging ios project into ipa package

  npm run pack:android
  (Requires Android build tools)
  Packaging android project into apk package

  npm run pack:web
  Packaging html5 project into `web/build` folder

  npm run test
  Starts the test runner

To get started:

  cd day01
  npm start

Enjoy your hacking time!

npm start 启动第一个hello word 项目:

 

 

参考链接:https://www.colabug.com/2018767.html(weex 环境搭建)

注意:在选择registry时强烈建议选择国内淘宝的,npm库国内网络连接很不稳定,我刚开始设置的npm库,但是weex安装未成功,后来把registry修改成淘宝的了,才可以成功安装weex;

registry = "https://registry.npm.taobao.org"

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

lixiaotao_1

谢谢老板!~~

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值