Git Product home page Git Product logo

incubator-weex-cli's Introduction

Weex Toolkit

image | left image | left GitHub issues Npm package Build status

Weex Toolkit is the Standard Tooling for Weex Development.

Introduction

This document is for the weex-toolkit 2.x version. For the old version of the weex-toolkit documentation, please go to here.

Weex Toolkit is dedicated to standardizing the tool base in the Weex ecosystem. It ensures that various build tools can be seamlessly connected based on smart default configuration, so you can focus on writing applications without having to spend days tangling configuration issues.

System Components

Weex Toolkit split each function module into separate parts, if you see our source code , you will find that we manage multiple separate releases in the repository via Lerna Package, providing the following functional modules:

Project Status Description
@weex-cli/core @weex-cli/core Core module for weex-toolkit
@weex-cli/generator @weex-cli/generator Plugin for quickly init the official project
@weex-cli/compile @weex-cli/compile Plugin for quickly compile Weex file.
@weex-cli/preview @weex-cli/preview Plugin for quickly preview the Weex page
@weex-cli/debug @weex-cli/debug Plugin for compile weex files and debug the Weex page
@weex-cli/doctor @weex-cli/doctor Plugin for quickly checks the user's local development environment
@weex-cli/lint @weex-cli/lint Plugin for performs quality diagnostics on local .vue files
@weex-cli/device @weex-cli/device Plugin for quickly manages user local devices
@weex-cli/run @weex-cli/run Plugin for quickly run weex's iOS/Android/Web project

Getting Started

Reuirements

  • node >= 7.6.0
  • iOS developer tools like XCode
  • Android SDK and ADB

Now you can install the latest version use below command:

$ npm i weex-toolkit -g

To know more detail about the command, you can run:

$ weex --help

Also you can see the document here.

incubator-weex-cli's People

Contributors

balloonzzq avatar cnryb avatar cxfeng1 avatar cxfeng1-zz avatar darin726 avatar dependabot[bot] avatar dickeylth avatar erha19 avatar erisu avatar exolution avatar ggice avatar hacke2 avatar jackpu avatar jakelin avatar jinjiang avatar joshthederf avatar luics avatar lvscar avatar mario-huang avatar mrraindrop avatar nazrdogan avatar nickeylin avatar river42069 avatar songsiqi avatar tancy avatar terrykingcha avatar tralves avatar willemjiang avatar yorkshen avatar zhuangzaiqian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

incubator-weex-cli's Issues

help message missing

npmlog.info(yargs.help())

had fixed to

npmlog.info(yargs.showHelp())

in this repo, but not yet in npm (weex version 0.6.3)

Error: Error watching file for changes: EMFILE

每次保存文件都出错退出,终端中就这些信息提示:

2016-11-18 16:51 node[6764] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-11-18 16:51 node[6764] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
2016-11-18 16:51 node[6764] (FSEvents.framework) FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc() => (null) (-22)
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: Error watching file for changes: EMFILE
    at exports._errnoException (util.js:1026:11)
    at FSEvent.FSWatcher._handle.onchange (fs.js:1406:11)

然后我需要再去重开weex index.we.

我是imac10.10.5i系统

关于 hot-reload

当使用 weex --qr 预览我的 app 的时候,使用 weex playground 可以实时预览,且代码变动后会触发 hot-reload.
同时可以通过 http://xxxx:xxxx/weex_tmp/h5_render/?hot-reload_controller&page=main.js&loader=xhr这个地址在网页上进行 h5预览。

这两个任意一个都没问题,但当两个同时开着的时候,手机上的 playground 就无法触发 hot-reload 了,
ios 上的 playground也不像安卓上一样有刷新按钮。。。要重新扫码才行,不知道是什么原因。
尝试通过抓包工具,发现确实开启了网页后,ios 上就没有请求发出了。

help...

demo官方

demo哪里下载啊,我一直是用Android studio开发,是不是需要其他软件一起弄啊,

Missing 'prompt' dependency in weex-toolkit@beta

Hello!

I installed weex-toolkit globally, but the got the error:

$ weex init hello-weex
{ Error: Cannot find module 'prompt'
    at Function.Module._resolveFilename (module.js:440:15)
    ...

I had to install prompt "manually" in the global package:

$ cd ~/.nodebrew/node/v6.2.2/lib/node_modules/weex-toolkit
$ npm install prompt

And then it worked.

Is it a missing dependency, or do I have something wrong here?

pls add `weex debug` help info

➜  proj weex --help

Usage: weex foo/bar/we_file_or_dir_path  [options]
Usage: weex init

Options:
  --qr          display QR code for native runtime, default action     [boolean]
  -o, --output  transform weex we file to JS Bundle, output path must specified
                (single JS bundle file or dir)
                [for create sub cmd]it specified we file output path
                                                 [default: "no JSBundle output"]
  --watch       using with -o , watch input path , auto run transform if change
                happen
  -s, --server  start a http file server, weex .we file will be transforme to JS
                bundle on the server , specify local root path using the option
                                                                        [string]
  --port        http listening port number ,default is 8081        [default: -1]
  --wsport      websocket listening port number ,default is 8082   [default: -1]
  --np          do not open preview browser automatic                  [boolean]
  -f, --force   [for create sub cmd]force to replace exsisting file(s) [boolean]
  --help        Show help                                              [boolean]
  -h, --host                                              [default: "127.0.0.1"]

Wrong ip with option `--qr`

➜  examples git:(dev) weex local-test.we --qr
info Wed Jul 06 2016 11:57:08 GMT+0800 (CST)WebSocket  is listening on port 8082
info Wed Jul 06 2016 11:57:08 GMT+0800 (CST)http  is listening on port 8081
The following QR encoding url is
http://127.94.0.1:8081/weex_tmp/h5_render/local-test.js
➜  proj weex --version
info 0.3.4

weex-toolkit@beta install error

➜ node_modules sudo npm install -g weex-toolkit@beta

[email protected] postinstall /usr/local/lib/node_modules/weex-toolkit
xtoolkit install weex-builder

npm ERR! Darwin 16.3.0
npm ERR! argv "/usr/local/Cellar/node@6/6.9.2/bin/node" "/usr/local/bin/npm" "install" "weex-builder" "--loglevel=error" "--registry=http://registry.npm.taobao.org"
npm ERR! node v6.9.2
npm ERR! npm  v3.10.8
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access

npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!     at Error (native)
npm ERR!  { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!     at Error (native)
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Darwin 16.3.0
npm ERR! argv "/usr/local/Cellar/node@6/6.9.2/bin/node" "/usr/local/bin/npm" "install" "weex-builder" "--loglevel=error" "--registry=http://registry.npm.taobao.org"
npm ERR! node v6.9.2
npm ERR! npm  v3.10.8
npm ERR! path npm-debug.log.3297600674
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open

npm ERR! Error: EACCES: permission denied, open 'npm-debug.log.3297600674'
npm ERR!     at Error (native)
npm ERR!  { Error: EACCES: permission denied, open 'npm-debug.log.3297600674'
npm ERR!     at Error (native)
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'open',
npm ERR!   path: 'npm-debug.log.3297600674' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/xujingbao/.xtoolkit/npm-debug.log

➜ node_modules ll
total 0
drwxr-xr-x 8 xujingbao admin 272B Dec 16 02:36 bower/
drwxr-xr-x 11 xujingbao admin 374B Jan 15 21:00 cooking-cli/
drwxr-xr-x 20 xujingbao admin 680B Dec 16 02:31 cordova/
drwxr-xr-x 20 xujingbao admin 680B Dec 16 02:17 ionic/
drwxr-xr-x 11 xujingbao admin 374B Dec 16 02:30 ios-deploy/
drwxr-xr-x 16 xujingbao admin 544B Dec 16 02:22 ios-sim/
drwxr-xr-x 27 xujingbao admin 918B Dec 16 02:03 npm/
drwxr-xr-x 10 xujingbao admin 340B Dec 16 02:09 nrm/
drwxr-xr-x 13 nobody staff 442B Jan 21 21:00 weex-toolkit/

vue语法class中不能写transition

week-toolkit: v1.0.1-beta.5

在class中如下定义会导致编译不能通过:

.fade-enter-active, .fade-leave-active {
transition: all .5s ease;
}

去掉 transition: all .5s ease; 这行就能通过

weex-toolkit无法正常启动

在macOS Sierra下运行命令“weex test.we --qr”后,二维码出现,之后程序就因错误退出了,截图如下,请问如何解决?

111111

用weex-toolkit调试页面报错

image

在用weex-toolkit debug的时候报错了,错误信息如上所示,这是否跟我在代码中定义了一个图片相对路劲有关?
module.exports = { data: { dogUrl : require('./img/dog1.png') } }
weex-toolkit是否没有对相对路径做响应的处理?

demo error

运行weex index.we --qr 或者weex index.we

info 0.5.8

用Playground扫二维码后(弹出浏览器页面后)报错:

fs.js:1431
throw error;
^

Error: watch vue-hackernews/node_modules/acorn ENOSPC
at exports._errnoException (util.js:1026:11)
at FSWatcher.start (fs.js:1429:19)
at Object.fs.watch (fs.js:1456:11)
at watch (/usr/lib/node_modules/weex-toolkit/node_modules/node-watch/lib/watch.js:221:8)
at /usr/lib/node_modules/weex-toolkit/node_modules/node-watch/lib/watch.js:230:9
at /usr/lib/node_modules/weex-toolkit/node_modules/node-watch/lib/watch.js:41:14
at Array.forEach (native)
at /usr/lib/node_modules/weex-toolkit/node_modules/node-watch/lib/watch.js:38:18
at FSReqWrap.oncomplete (fs.js:123:15)

PS:index.we在我的home

weex-toolkit debug时无法指定具体IP

qq 20160818155042

在使用 weex-toolkit debug时,笔记本电脑有两个IP,一个本地连接的IP( 10.20.12.37),另一个是虚拟热点的IP(192.168.137.1),而debug的-h xxx.xxx.xxx.xxx是无效的。chrome打开的仍然是虚拟热点的IP,而不是本地连接。而手机是无法连接192.168.137.1的,而debug又没有指定IP的参数,类似于非debug时的-h

有计划把 debugger 的部分从 toolkit 里拆分出来吗?

目前 weex debug 内部包含 webpack 的构建,但是配置项并没有暴露外部自定义的接口,是否有计划把调试模式下的构建和起 debug 服务拆分成独立的子模块,然后 weex-toolkit 内部调用的方式,这样方便第三方来扩展,而不是像现在绑定在内部比较死。

关于运行 weex/examples

发现很多 demo 代码并不能跑起来,
比如写了一个非常简单的页面想尝试下 web 标签,结果直接报错了。
example 里的 web-demo.html 也同样跑不起来。
想问一下 weex-toolkit 对这些的支持是不是还是比较落后的?

$weex debug foo.vue出错了

weex init 之后,直接 $weex debug src/foo.vue,二维码都出来了,但是扫码后报错(debug模式下)

wx20170203-122558 2x

安装 beta 版本报错

按照 官方文档 执行 tnpm i -g weex-toolkit@beta 报错:

wx-test ➤ tnpm install -g weex-toolkit@beta                                                                                   
> [email protected] postinstall /usr/local/lib/node_modules/weex-toolkit/node_modules/xtoolkit/node_modules/inquirer/node_modules/external-editor/node_modules/spawn-sync
> node postinstall
-
> [email protected] install /usr/local/lib/node_modules/weex-toolkit/node_modules/weex-previewer/node_modules/weex-builder/node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/fsevents
> node-pre-gyp install --fallback-to-build

[fsevents] Success: "/usr/local/lib/node_modules/weex-toolkit/node_modules/weex-previewer/node_modules/weex-builder/node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile

> [email protected] postinstall /usr/local/lib/node_modules/weex-toolkit/node_modules/weex-previewer
> node ./build/hook/post-install.js

module.js:471
    throw err;
    ^

Error: Cannot find module 'babel-runtime/helpers/typeof'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/weex-toolkit/node_modules/weex-previewer/build/hook/post-install.js:7:16)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
npm ERR! Darwin 16.3.0
npm ERR! node v6.9.2
npm ERR! npm  v2.15.11
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: `node ./build/hook/post-install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script 'node ./build/hook/post-install.js'.
npm ERR! This is most likely a problem with the weex-previewer package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./build/hook/post-install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs weex-previewer
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! 
npm ERR!     npm owner ls weex-previewer
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/hongshu/dev/gitlab/wx-test/npm-debug.log
wx-test ➤ tnpm -v                                                                                                             git:daily/0.1.0*
[email protected] (/usr/local/lib/node_modules/tnpm/bin/tnpm)
[email protected] (/usr/local/lib/node_modules/tnpm/node_modules/.2.15.11@npm/lib/npm.js)
[email protected] (/usr/local/bin/node)
[email protected] (/usr/local/lib/node_modules/tnpm/node_modules/.2.16.0@npminstall/lib/index.js)
prefix=/usr/local (load prefix from: $ npm config get prefix)
darwin x64 16.3.0

问个jsbundle的问题啊

用 $weex compile path/to/*.vue,*.js . 命令编译,会把所有的js文件都编成了一个。
那我如果要用其中一个文件的js,该怎么写啊:
比如
<embed v-for="item in tabItems" :src="item.src" type="weex" :style="{ visibility: item.visibility }" class="content" > </embed>

这里的:src需要写一个js文件,如果写 src: 'tabcontent.js?itemId=tab1'

这个tabcontent.js已经被编译到一个文件里面了,在ios平台上访问不到了,该怎么办。

npm install -g weex-toolkit@beta,安装输出报错

我是在Win下启动docker Ubuntu容器内操作的这一切,将win下的目录映射到容器/data目录,然后在此下操作的。
node: v6.9.2
npm:v3.10.9

详细报错信息如下:
root@59e355e9d016:/data# npm install -g weex-toolkit@beta
npm WARN deprecated [email protected]: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated [email protected]: to-iso-string has been deprecated, use @segment/to-iso-string instead.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
/usr/local/bin/weex -> /usr/local/lib/node_modules/weex-toolkit/bin/weex

[email protected] postinstall /usr/local/lib/node_modules/weex-toolkit/node_modules/spawn-sync
node postinstall

[email protected] postinstall /usr/local/lib/node_modules/weex-toolkit/node_modules/weex-previewer
node ./src/hook/post-install.js

Error:permission denied.Please apply the write premission to the directory: "/root"

[email protected] postinstall /usr/local/lib/node_modules/weex-toolkit
xtoolkit install weex-builder

fs.js:922
return binding.mkdir(pathModule._makeLong(path),
^

Error: EACCES: permission denied, mkdir '/root/.xtoolkit'
at Error (native)
at Object.fs.mkdirSync (fs.js:922:18)
at Object.exports.init (/usr/local/lib/node_modules/weex-toolkit/node_modules/xtoolkit/src/util/index.js:29:12)
at Command. (/usr/local/lib/node_modules/weex-toolkit/node_modules/xtoolkit/bin/xtoolkit.js:10:10)
at Command.listener (/usr/local/lib/node_modules/weex-toolkit/node_modules/xtoolkit/node_modules/commander/index.js:301:8)
at emitTwo (events.js:106:13)
at Command.emit (events.js:191:7)
at Command.parseArgs (/usr/local/lib/node_modules/weex-toolkit/node_modules/xtoolkit/node_modules/commander/index.js:615:12)
at Command.parse (/usr/local/lib/node_modules/weex-toolkit/node_modules/xtoolkit/node_modules/commander/index.js:458:21)
at Object. (/usr/local/lib/node_modules/weex-toolkit/node_modules/xtoolkit/bin/xtoolkit.js:17:9)
/usr/local/lib
`-- (empty)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/weex-toolkit/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! Linux 4.9.4-moby
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "weex-toolkit@beta"
npm ERR! node v6.9.2
npm ERR! npm v3.10.9
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: xtoolkit install weex-builder
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'xtoolkit install weex-builder'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the weex-toolkit package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! xtoolkit install weex-builder
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs weex-toolkit
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls weex-toolkit
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /data/npm-debug.log
npm ERR! code 1

Module build failed: Error: Couldn't find preset "es2015" relative to directory

Module build failed: Error: Couldn't find preset "es2015" relative to directory "/Users/wujun/workspace/weex"
at /Users/wujun/workspace/weex/wxapp/node_modules/babel-core/lib/transformation/file/options/option-manager.js:299:19
at Array.map (native)
at OptionManager.resolvePresets (/Users/wujun/workspace/weex/wxapp/node_modules/babel-core/lib/transformation/file/options/option-manager.js:270:20)
at OptionManager.mergePresets (/Users/wujun/workspace/weex/wxapp/node_modules/babel-core/lib/transformation/file/options/option-manager.js:259:10)
at OptionManager.mergeOptions (/Users/wujun/workspace/weex/wxapp/node_modules/babel-core/lib/transformation/file/options/option-manager.js:244:14)
at OptionManager.init (/Users/wujun/workspace/weex/wxapp/node_modules/babel-core/lib/transformation/file/options/option-manager.js:374:12)
at File.initOptions (/Users/wujun/workspace/weex/wxapp/node_modules/babel-core/lib/transformation/file/index.js:216:65)
at new File (/Users/wujun/workspace/weex/wxapp/node_modules/babel-core/lib/transformation/file/index.js:139:24)
at Pipeline.transform (/Users/wujun/workspace/weex/wxapp/node_modules/babel-core/lib/transformation/pipeline.js:46:16)
at transpile (/Users/wujun/workspace/weex/wxapp/node_modules/babel-loader/index.js:38:20)
at Object.module.exports (/Users/wujun/workspace/weex/wxapp/node_modules/babel-loader/index.js:131:12)
@ ./src/weex-bootstrap.we?entry=true 2:22-518

Postinstall fails with `xtoolkit install weex-builder`

When I tried to install weex-toolkit, it seems to error at postinstall

node -v: v6.3.1
npm -v: 3.10.3

command: sudo npm i -g weex-toolkit@beta

Log:

npm WARN deprecated [email protected]: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated [email protected]: to-iso-string has been deprecated, use @segment/to-iso-string instead.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
/usr/local/bin/weex -> /usr/local/lib/node_modules/weex-toolkit/bin/weex

> [email protected] postinstall /usr/local/lib/node_modules/weex-toolkit/node_modules/spawn-sync
> node postinstall


> [email protected] postinstall /usr/local/lib/node_modules/weex-toolkit/node_modules/weex-previewer
> node ./src/hook/post-install.js

Error:permission denied.Please apply the write premission to the directory: "/home/iniz" 

> [email protected] postinstall /usr/local/lib/node_modules/weex-toolkit
> xtoolkit install weex-builder

/usr/local/lib/node_modules/weex-toolkit/node_modules/xtoolkit/src/util/index.js:8
    let args = ['install', name, '--loglevel=error'];
    ^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/weex-toolkit/node_modules/xtoolkit/bin/xtoolkit.js:6:14)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
/usr/local/lib
└── (empty)

v-for指令不能用?

1、查看了官网的例子,v-for替换成repeat才行
2、weex.requireModule is not a function ,查看了weex实例,并没有require相关的方法

npm install -g weex-tookit

win10和win7都安装报错
C:\Users\test>cnpm install -g weex-toolkit
[[email protected]] download from binary mirror: {"module_name":"fse","module_path":"./lib/binding/{configuration}/{node_abi}-{platform}-{arch}/","remote_path":"./v{version}/","package_name":"{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz","host":"https://npm.taobao.org/mirrors/fsevents"}
[email protected] unsupported: Package require os(darwin) not compatible with your platform(win32)
[fsevents@^1.0.0] optional install error: Package require os(darwin) not compatible with your platform(win32)
[[email protected]] link C:\Users\test\AppData\Roaming\npm\weex@ -> C:\Users\test\AppData\Roaming\npm\weex
[weex-toolkit@*] installed at node_modules.weex-toolkit_npminstall\weex-toolkit\0.4.3\weex-toolkit (432 packages, use 17s, speed 170.71kB/s, json 2.8MB, tarball 0B)
excute post install scripts...
[[email protected]] scripts.install: "node-gyp rebuild" at .\AppData\Roaming\npm\node_modules.weex-toolkit_npminstall\bufferutil\1.2.1\bufferutil
在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。
MSBUILD : error MSB6006: "VCBuild.exe" exited with code -1. [C:\Users\test\AppData\Roaming\npm\node_modules.we
ex-toolkit_npminstall\bufferutil\1.2.1\bufferutil\build\binding.sln]
gyp ERR! build error
gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\test\AppData\Roaming\npm\node_modules\cnpm\node_modules\npminstall\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.10240
gyp ERR! command "D:\developtool\tools\nodejs\node.exe" "C:\Users\test\AppData\Roaming\npm\node_modules\cnpm\node_modules\npminstall\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\test\AppData\Roaming\npm\node_modules.weex-toolkit_npminstall\bufferutil\1.2.1\bufferutil
gyp ERR! node -v v4.4.7
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
[Error: Run "C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild" error, exit code 1
at ChildProcess. (C:\Users\test\AppData\Roaming\npm\node_modules\cnpm\node_modules\npminstall\node_modules\runscript\index.js:67:21)
at emitTwo (events.js:87:13)

使用 `weex xxx.we` 在网页上预览时产生的尺寸计算错误,没有定义 `viewport`

你好,我在使用 weex-toolkit 在网页端预览调试时发现一个尺寸计算上的错误, 具体如下:

weex-toolkit 生成的 index.html 页面中没有对 viewport 的定义,导致在 chrome 下模拟手机调试时会按照 webkit 默认的 980px 的宽度渲染页面,并产生尺寸计算与预期不符的现象。

例如在 we 文件中定义 padding: 20 ,实际预览时却是 padding: 26.13 ,无论调试时设置的手机宽度是多少。

当然,在不使用模拟手机的方式调试时是没有问题的。

安装weex-toolkit失败

谁给看看,错误信息如下:

➜  weex git:(dev) sudo npm install -g weex-toolkit
npm WARN peerDependencies The peer dependency vue-template-compiler@^2.0.0 included from vue-loader will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency vue-template-compiler@^2.0.0 included from weex-vue-loader will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN deprecated [email protected]: to-iso-string has been deprecated, use @segment/to-iso-string instead.
npm WARN deprecated [email protected]: Jade has been renamed to pug, please install the latest version of pug instead of jade

> [email protected] postinstall /Users/xiangwenwen/.nvm/versions/node/v4.6.0/lib/node_modules/weex-toolkit/node_modules/xtoolkit/node_modules/inquirer/node_modules/external-editor/node_modules/spawn-sync
> node postinstall

npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
-
> [email protected] install /Users/xiangwenwen/.nvm/versions/node/v4.6.0/lib/node_modules/weex-toolkit/node_modules/weex-previewer/node_modules/weex-builder/node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/fsevents
> node-pre-gyp install --fallback-to-build

[fsevents] Success: "/Users/xiangwenwen/.nvm/versions/node/v4.6.0/lib/node_modules/weex-toolkit/node_modules/weex-previewer/node_modules/weex-builder/node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/fsevents/lib/binding/Release/node-v46-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile

> [email protected] postinstall /Users/xiangwenwen/.nvm/versions/node/v4.6.0/lib/node_modules/weex-toolkit/node_modules/weex-previewer
> node ./src/hook/post-install.js

/Users/xiangwenwen/.nvm/versions/node/v4.6.0/lib/node_modules/weex-toolkit/node_modules/weex-previewer/src/libs/fs-utils.js:24
  let exists = fs.existsSync(src);
  ^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/Users/xiangwenwen/.nvm/versions/node/v4.6.0/lib/node_modules/weex-toolkit/node_modules/weex-previewer/src/hook/post-install.js:4:18)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
npm ERR! Darwin 16.3.0
npm ERR! argv "/Users/xiangwenwen/.nvm/versions/node/v4.6.0/bin/node" "/Users/xiangwenwen/.nvm/versions/node/v4.6.0/bin/npm" "install" "-g" "weex-toolkit"
npm ERR! node v4.6.0
npm ERR! npm  v2.15.9
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: `node ./src/hook/post-install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node ./src/hook/post-install.js'.
npm ERR! This is most likely a problem with the weex-previewer package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./src/hook/post-install.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs weex-previewer
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls weex-previewer
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/xiangwenwen/opensource/weex/npm-debug.log

node 版本 v4.6.0
npm 版本 v.2.15.9

fail to install weex-toolkit because invalid name '@f/defaults'

$node-gyp --version 
v3.4.0

when running the command cnpm install -g weex-toolkit, get the messages:

npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "--registry=http://registry.npm.taobao.org" "--cache=/Users/hygkui/.npm/.cache/tnpm" "--disturl=https://npm.taobao.org/dist" "--userconfig=/Users/hygkui/.tnpmrc" "install" "-g" "weex-toolkit"
npm ERR! node v5.8.0
npm ERR! npm  v3.7.3

npm ERR! Invalid name: "@f/defaults"
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

i have googled this problem, but cannot resolve it, so i put this issue here if anyone meet the same problem.

安装报错

npm ERR! Darwin 16.4.0
npm ERR! argv "/usr/local/Cellar/nvm/0.29.0/versions/node/v5.3.0/bin/node" "/usr/local/Cellar/nvm/0.29.0/versions/node/v5.3.0/bin/npm" "install" "weex-toolkit@beta" "-g"
npm ERR! node v5.3.0
npm ERR! npm v3.10.6
npm ERR! code ELIFECYCLE

npm ERR! [email protected] postinstall: xtoolkit install weex-builder
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'xtoolkit install weex-builder'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the weex-toolkit package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! xtoolkit install weex-builder
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs weex-toolkit
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls weex-toolkit
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/youzehong/npm-debug.log
npm ERR! code 1

Enhancement about error message

<template>
  <div></div>
</template>
<style>
/style>

When we miss a < at </style> code. No more error message except ERR! ModuleBuildError: Module build failed: only. It should better be more friendly.

华为手机weex debug 报错:Warning:The session with native was closed,please restart your native app!

后端错误如下:
You can visit we file(s) use http://192.168.11.16:8088/weex/tmprovence.js
Also you can use Playground App to scan the qrcode on device list page.

The websocket address for native is ws://192.168.11.16:8088/debugProxy/native
Launching Dev Tools...
can not join session,unknown sessionId[null]
@(D:\Program Files\nodejs\npm-global\node_modules\weex-toolkit\node_modules\weex
-devtool\lib\components\P2PSession.js:218:24)

windows `weex init ` missing devDependencies

win7 x64 git-windows node v5.6.0
cnpm install -g weex-toolkit
weex init 
enter
enter
...

cnpm run dev

> [email protected] dev F:\0_front\weex-zhihu
> webpack --watch & serve -p 12580

'webpack' ▒▒▒▒▒ڲ▒▒▒▒ⲿ▒▒▒Ҳ▒▒▒ǿ▒▒▒▒еij▒▒▒
▒▒▒▒▒▒▒▒▒ļ▒▒▒
'serve' ▒▒▒▒▒ڲ▒▒▒▒ⲿ▒▒▒Ҳ▒▒▒ǿ▒▒▒▒еij▒▒▒
▒▒▒▒▒▒▒▒▒ļ▒▒▒

find out in package.json ,missing 'devDependencies' prop

add it from weex-toolkit/project-template

"devDependencies": {     
    "serve": "^1.4.0",     
    "webpack": "^1.13.1",    
    "weex-html5": "0.2.18",    
    "weex-loader": "^0.1.5"     
  }

cnpm install

it works!!

外部引入js文件是否能使用es6

外部 index.js

  export function log(){
     console.log('log info')
  }

.we文件中引入

require("./index.js");
module.exports = {
  init: function(){
    log();
  }
}

浏览器显示error : Unexpected token export

看到 weex-toolkit中 gulp的task中有 babel,不知道哪里有问题。 谢谢

How can I debug in Chrome with --watch

Hell, I have a trouble.

I have learn weex and preview it in chrome use weex test.we, it can open a chrmoe tab and show the page what I built. But when I change that .we file, I have to use Control + C to stop terminal and re-run weex test.we.

There is an usage in http://alibaba.github.io/weex/doc/tools/cli.html, and I use weex test.we --watch to work.

It works well when I change my .we file first time. But when I make changes second time, I got an error ---

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.