安裝
- 先安裝node.js環(huán)境
- sudo npm install -g weex-toolkit
安裝信息異常
- 異常:user "root" does not have permission to access the dev dir "/Users/iluoxuan/.node-gyp/0.12.0"
- 修復(fù):sudo chmod -R 777 /Users/iluoxuan/.node-gyp
- 查看weex版本:weex -version
異常信息
function* promiseToGenerator(promise) {
^
SyntaxError: Unexpected token *
嘗試升級node
- 這里需要全局安裝:sudo npm install -g n
- 升級node.js到最新穩(wěn)定版:sudo n stable
升級完成
git weex --version
info 0.4.2
創(chuàng)建weex工程
- mkdir weex-test
- cd weex-test
- weex init
prompt: Project Name: (weex-test)
file: .gitignore created.
file: README.md created.
file: index.html created.
file: package.json created.
file: src/main.we created.
file: webpack.config.js created.
```
* 安裝依賴: sudo npm install
* 修改 package.json:
```
"dev": "webpack --watch & serve -p 12580"
```
* 運(yùn)行:npm run dev
```
/Users/iluoxuan/git/weex-test on port 12580
```
* 訪問localhost:12580 就可以看到hello weex
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者