一、 安裝node.js css
官網下載:https://nodejs.org/en/ 下載推薦版本;html
二、 Npm安裝慢,能夠使用cnpm,安裝淘寶鏡像:node
npm install -g cnpm --registry=https://registry.npm.taobao.orgreact
三、 全局安裝 Taro 開發工具 @tarojs/cligit
cnpm install -g @tarojs/cligithub
四、 進入項目目錄,使用命令建立模板項目npm
taro init myApp小程序
根據提示選擇本身須要的安裝微信小程序
五、 以h5爲例,建立項目完畢,運行項目sass
cd myApp
npm run dev:h5
運行項目報錯:
./node_modules/@tarojs/components/src/components/text/style/index.scss)
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (64)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.8.3
需在當前項目從新安裝sass:
cnpm install node-sass
到此,項目即可正常運行。
六、taro不只支持微信小程序還支持百度小程序,支付寶小程序,H5,react native等等,具體可進入官網瞭解更多,官網地址: