Windows下搭建Vue脚手架CLI

Posted lwjqaq

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Windows下搭建Vue脚手架CLI相关的知识,希望对你有一定的参考价值。

Vue CLI的使用依赖Node.js,先按照Node.js环境。

//安装环境
C:Users16779>npm install --global vue-cli npm WARN deprecated coffee[email protected]1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen) [ .................] | fetchMetadata: sill resolveWithNewModule [email protected]4.1.1 check[ .................] - fetc[ .................] / fetchMetadata: sill resolveWithNewModule os-tm[ .................] | fetchMetadata: sill resolveWC:Users16779AppDataRoaming pmvue-init -> C:Users16779AppDataRoaming pm ode_modulesvue-cliinvue-init C:Users16779AppDataRoaming pmvue -> C:Users16779AppDataRoaming pm ode_modulesvue-cliinvue C:Users16779AppDataRoaming pmvue-list -> C:Users16779AppDataRoaming pm ode_modulesvue-cliinvue-list + [email protected]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:HBuilderVue
>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 [email protected]2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools. npm WARN deprecated bfj[email protected]5.3.1: Switch to the `bfj` package for fixes and new features! npm WARN deprecated [email protected]1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools. > [email protected]0.4.6 postinstall E:HBuilderVuevue-playlist ode_moduleswebpack ode_modulesuglifyjs-webpack-plugin > node lib/post_install.js npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN ajv[email protected]3.2.0 requires a peer of [email protected]^6.0.0 but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]1.2.4 (node_modulesfsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]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:HBuilderVue>cd vue-playlist //运行 E:HBuilderVuevue-playlist>npm run dev > [email protected]1.0.0 dev E:HBuilderVuevue-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的主要内容,如果未能解决你的问题,请参考以下文章

在windows下用脚手架搭建vue环境

脚手架(vue-cli)搭建之后的简单介绍

vue.js学习vue-cli脚手架搭建

使用vue-cli脚手架自动化搭建一个vue项目

Windows 环境下vue+webpack前端开发环境搭建

vue-cli 快速搭建脚手架