Windows下搭建Vue腳手架CLI
阿新 • • 發佈:2018-12-15
unit webpack webp ren cati lib etc row -c
Vue CLI的使用依賴Node.js,先按照Node.js環境。
//安裝環境
C:\Users\16779>npm install --global vue-cli npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen) [ .................] | fetchMetadata: sill resolveWithNewModule decompress-tarbz2@4.1.1 check[ .................] - fetc[ .................] / fetchMetadata: sill resolveWithNewModule os-tm[ .................] | fetchMetadata: sill resolveWC:\Users\16779\AppData\Roaming\npm\vue-init -> C:\Users\16779\AppData\Roaming\npm\node_modules\vue-cli\bin\vue-init C:\Users\16779\AppData\Roaming\npm\vue -> C:\Users\16779\AppData\Roaming\npm\node_modules\vue-cli\bin\vue C:\Users\16779\AppData\Roaming\npm\vue-list -> C:\Users\16779\AppData\Roaming\npm\node_modules\vue-cli\bin\vue-list+ vue-cli@2.9.6 added 239 packages from 206 contributors in 116.305s
//安裝好後查看版本 C:\Users\16779>vue --version 2.9.6
//切換到你想要保存項目的路徑 C:\Users\16779>E: E:\>cd HBuilder E:\HBuilder>cd Vue
//初始化項目 E:\HBuilder\Vue>vue init webpack vue-playlist
//初始化配置 ‘git‘ ????????????????????????е???? ?????????????? Project name vue-playlist ? Project description Vue ? Author lwj ? Vue build standalone ? Install vue-router? No ? 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-playlist". //選擇安裝(等待下載) # Installing project dependencies ... # ======================== npm WARN deprecated browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools. npm WARN deprecated bfj-node4@5.3.1: Switch to the `bfj` package for fixes and new features! npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools. > uglifyjs-webpack-plugin@0.4.6 postinstall E:\HBuilder\Vue\vue-playlist\node_modules\webpack\node_modules\uglifyjs-webpack-plugin > node lib/post_install.js npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) added 1126 packages from 647 contributors and audited 10641 packages in 229.663s found 2 vulnerabilities (1 moderate, 1 high) run `npm audit fix` to fix them, or `npm audit` for details # Project initialization finished! # ======================== To get started: cd vue-playlist npm run dev Documentation can be found at https://vuejs-templates.github.io/webpack //切換到項目安裝路徑 E:\HBuilder\Vue>cd vue-playlist //運行 E:\HBuilder\Vue\vue-playlist>npm run dev > vue-playlist@1.0.0 dev E:\HBuilder\Vue\vue-playlist > webpack-dev-server --inline --progress --config build/webpack.dev.conf.js 95% emitting DONE Compiled successfully in 3636ms 15:53:00 //訪問路徑 I Your application is running here: http://localhost:8080
Windows下搭建Vue腳手架CLI