下載并安裝node.js
查看node版本命令
node -v
查看npm版本命令
npm -v
安裝淘寶npm鏡像
$ npm install -g cnpm --registry=https://registry.npm.taobao.org
安裝腳手架
安裝一次就可以棍掐,不用每次建項目都安裝
cnpm install vue-cli -g //全局安裝 vue-cli
查看vue-cli是否成功,不能檢查vue-cli,需要檢查vue
vue list
創(chuàng)建項目
vue init webpack ”項目名稱“
D:\vue_projects>vue init webpack vue_test2
? Project name vue_test2
? Project description A Vue.js project
? Author liukai <598724366@qq.com>
? Vue build standalone
? Install vue-router? Yes
? Use ESLint to lint your code? No
? Set up unit tests No
? Setup e2e tests with Nightwatch? No
? Should we run `npm install` for you after the project has been created? (recommended) npm
vue-cli · Generated "vue_test2".
現(xiàn)在已經創(chuàng)建好了拷况,那就讓項目先安裝下依賴再運行一下作煌,會出現(xiàn)下面的頁面掘殴,操作指令是:
cnpm install
cnpm run dev