認知:html
注:上面的圖片轉自Vue2.0 新手入門 — 從環境搭建到發佈 vue
一、安裝brew
打開終端運行如下命令:node
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
二、安裝node.js
在終端中運行如下命令:webpack
brew install nodejs
三、獲取nodejs模塊安裝目錄訪問權限git
sudo chmod -R 777 /usr/local/lib/node_modules/
四、安裝 淘寶鏡像 (npm)github
npm install -g cnpm --registry=https://registry.npm.taobao.org
五、安裝webpackweb
cnpm install webpack -g
六、安裝vue腳手架vue-router
npm install vue-cli -g
七、在硬盤上找一個文件夾放工程用的,在終端中進入該目錄vue-cli
八、根據模板建立項目npm
vue init webpack-simple 工程名字<工程名字不能用中文>
以下
vue init webpack-simple demo1
cd 命令進入建立的工程目錄
九、安裝項目依賴
npm install
十、安裝 vue 路由模塊vue-router和網絡請求模塊vue-resource
cnpm install vue-router vue-resource --save
十一、啓動項目
npm run dev