搭建 vue 环境

news/2024/11/24 7:07:44/

第一步:安装node

http://nodejs.cn/

在控制台CMD命令输入 node   -v, 如果提示v开头的版本号, 则证明node安装成功

第二步:安装Git

Git官网 : https://git-scm.com/download/win 选择64位安装包

https://github.com/git-for-windows/git/releases/download/v2.19.0.windows.1/Git-2.19.0-64-bit.exe

第三步:vue-cli脚手架安装

在控制台CMD命令输入 npm install -g cnpm --registry=https://registry.npm.taobao.org

$ npm install -g cnpm --registry=https://registry.npm.taobao.org
npm WARN deprecated socks@1.1.10: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
C:\Users\zhang\AppData\Roaming\npm\cnpm -> C:\Users\zhang\AppData\Roaming\npm\node_modules\cnpm\bin\cnpm
+ cnpm@6.0.0
added 633 packages from 843 contributors in 25.411s
$ cnpm install cnpm@6.0.0
√ Installed 1 packages
√ Linked 226 latest versions
√ Run 0 scripts
deprecate cnpm@6.0.0 › npm-request@1.0.0 › urllib@2.30.0 › proxy-agent@2.3.1 › socks-proxy-agent@3.0.1 › socks@^1.1.10 If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
Recently updated (since 2018-09-27): 3 packages (detail see file C:\Users\zhang\Desktop\node\node_modules\.recently_updates.txt)
√ All packages installed (247 packages installed from npm registry, used 13s(network 13s), speed 854.28kB/s, json 227(2.29MB), tarball 8.36MB)
$ cnpm -v
cnpm@6.0.0 (C:\Users\zhang\AppData\Roaming\npm\node_modules\cnpm\lib\parse_argv.js)
npm@6.4.1 (C:\Users\lixiaodong\AppData\Roaming\npm\node_modules\cnpm\node_modules\npm\lib\npm.js)
node@10.8.0 (C:\Program Files\nodejs\node.exe)
npminstall@3.12.0 (C:\Users\zhang\AppData\Roaming\npm\node_modules\cnpm\node_modules\npminstall\lib\index.js)
prefix=C:\Users\zhang\AppData\Roaming\npm
win32 x64 10.0.17134
registry=https://registry.npm.taobao.org
$ npm install vue-cli -g
npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
C:\Users\zhang\AppData\Roaming\npm\vue-list -> C:\Users\zhang\AppData\Roaming\npm\node_modules\vue-cli\bin\vue-list
C:\Users\zhang\AppData\Roaming\npm\vue-init -> C:\Users\zhang\AppData\Roaming\npm\node_modules\vue-cli\bin\vue-init
C:\Users\zhang\AppData\Roaming\npm\vue -> C:\Users\zhang\AppData\Roaming\npm\node_modules\vue-cli\bin\vue
+ vue-cli@2.9.6
added 237 packages from 205 contributors in 76.411s

第四步:初始化项目

新建一个存放项目的文件夹dev,打开该文件夹,然后鼠标右键点击,选择Git  Bash  Here,打开了控制台窗口

然后执行命令:vue init webpack vue-demo, 可以一路回车键

$ vue init webpack vue-demo? Target directory exists. Continue? (Y/n) y
? Target directory exists. Continue? Yes
? Project name (vue-demo)
? Project name vue-demo
? Project description (A Vue.js project)
? Project description A Vue.js project
? Author (zhangsj <1036259645@qq.com>)
? Author zhangsj <1036259645@qq.com>
? Vue build standalone
? Install vue-router? (Y/n)
? Install vue-router? Yes
? Use ESLint to lint your code? (Y/n) y
? Use ESLint to lint your code? Yes
? Pick an ESLint preset (Use arrow keys)
? Pick an ESLint preset Standard
? Set up unit tests (Y/n) n
? Set up unit tests No
? Setup e2e tests with Nightwatch? (Y/n) n
? Setup e2e tests with Nightwatch? No
? Should we run `npm install` for you after the project has been created? (recom
? Should we run `npm install` for you after the project has been created? (recom
mended) npmvue-cli · Generated "vue-demo".# Installing project dependencies ...
# ========================npm notice created a lockfile as package-lock.json. You should commit this file.
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"})removed 301 packages and audited 11098 packages in 13.265s
found 1 moderate severity vulnerabilityrun `npm audit fix` to fix them, or `npm audit` for detailsRunning eslint --fix to comply with chosen preset rules...
# ========================> vue-demo@1.0.0 lint C:\Users\lixiaodong\Desktop\dev\vue-demo
> eslint --ext .js,.vue src "--fix"# Project initialization finished!
# ========================To get started:cd vue-demonpm run devDocumentation can be found at https://vuejs-templates.github.io/webpack

这样一个脚手架框架就搭建好了。

第五步:运行

$ npm run dev> vue-demo@1.0.0 dev C:\Users\lixiaodong\Desktop\dev\vue-demo
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js10% building modules 0/1 modules 1 active ... webpack/hot/dev-server ./src/main 10% building modules 1/2 modules 1 active ...ode_modules\webpack\hot\dev-server 10% building modules 2/3 modules 1 active ...client\index.js?http://localhost:8 10% building modules 2/4 modules 2 active ...dong\Desktop\dev\vue-demo\src\main 10% building modules 2/5 modules 3 active ...-demo\node_modules\webpack\hot\log 10% building modules 2/6 modules 4 active ...o\node_modules\webpack\hot\emitter 10% building modules 2/7 modules 5 active ...dules\webpack\hot\log-apply-result 10% building modules 3/7 modules 4 active ...dules\webpack\hot\log-apply-result 10% building modules 4/7 modules 3 active ...dules\webpack\hot\log-apply-result 10% building modules 5/7 modules 2 active ...dules\webpack\hot\log-apply-result 10% building modules 6/7 modules 1 active ...dules\webpack\hot\log-apply-result 10% building modules 7/8 modules 1 active ...\webpack\hot nonrecursive /^\.\/lo 10% building modules 7/9 modules 2 active ...s\webpack-dev-server\client\socket 10% building modules 7/10 modules 3 active ...\webpack-dev-server\client\overla 10% building modules 8/10 modules 2 active ...\webpack-dev-server\client\overla 10% building modules 8/11 modules 3 active ...\dev\vue-demo\node_modules\url\ur 10% building modules 8/12 modules 4 active ...demo\node_modules\vue\dist\vue.es 11% building modules 9/12 modules 3 active ...demo\node_modules\vue\dist\vue.es 11% building modules 10/12 modules 2 active ...demo\node_modules\vue\dist\vue.e 11% building modules 10/13 modules 3 active ...ue-demo\node_modules\events\even 11% building modules 11/13 modules 2 active ...ue-demo\node_modules\events\even 11% building modules 11/14 modules 3 active ...ktop\dev\vue-demo\src\router\ind 11% building modules 12/14 modules 2 active ...ktop\dev\vue-demo\src\router\ind 11% building modules 12/15 modules 3 active ...demo\node_modules\strip-ansi\ind 11% building modules 13/15 modules 2 active ...demo\node_modules\strip-ansi\ind 11% building modules 13/16 modules 3 active ...dev\vue-demo\node_modules\url\ut 11% building modules 13/17 modules 4 active ...node_modules\loglevel\lib\loglev 11% building modules 13/18 modules 5 active ...dong\Desktop\dev\vue-demo\src\Ap 11% building modules 13/19 modules 6 active ..._modules\sockjs-client\dist\sock 11% building modules 13/20 modules 7 active ...emo\node_modules\punycode\punyco 11% building modules 13/21 modules 8 active ...node_modules\querystring-es3\ind 11% building modules 14/21 modules 7 active ...node_modules\querystring-es3\ind 11% building modules 15/21 modules 6 active ...node_modules\querystring-es3\ind 11% building modules 16/21 modules 5 active ...node_modules\querystring-es3\ind 12% building modules 17/21 modules 4 active ...node_modules\querystring-es3\ind 12% building modules 18/21 modules 3 active ...emo\node_modules\punycode\punyco 12% building modules 18/22 modules 4 active ...-demo\node_modules\ansi-html\ind 12% building modules 19/22 modules 3 active ...-demo\node_modules\ansi-html\ind 12% building modules 19/23 modules 4 active ...ue-demo\src\components\HelloWorl 12% building modules 19/24 modules 5 active ...o\node_modules\html-entities\ind 12% building modules 20/24 modules 4 active ...o\node_modules\html-entities\ind 12% building modules 20/25 modules 5 active ...ode_modules\webpack\buildin\modu 12% building modules 20/26 modules 6 active ...ode_modules\webpack\buildin\glob 12% building modules 20/27 modules 7 active ...ode_modules\querystring-es3\enco 12% building modules 20/28 modules 8 active ...ode_modules\querystring-es3\deco 12% building modules 20/29 modules 9 active ...dong\Desktop\dev\vue-demo\src\Ap 12% building modules 21/29 modules 8 active ...ode_modules\querystring-es3\deco 12% building modules 21/30 modules 9 active ...ue-loader\lib\component-normaliz 12% building modules 21/31 modules 10 active ...dong\Desktop\dev\vue-demo\src\A 12% building modules 22/31 modules 9 active ...ue-loader\lib\component-normaliz 12% building modules 23/31 modules 8 active ...ue-loader\lib\component-normaliz 12% building modules 24/31 modules 7 active ...ue-loader\lib\component-normaliz 12% building modules 24/32 modules 8 active ...ue-demo\src\components\HelloWorl 12% building modules 24/33 modules 9 active ...ue-demo\src\components\HelloWorl 13% building modules 25/33 modules 8 active ...ue-demo\src\components\HelloWorl 13% building modules 26/33 modules 7 active ...ue-loader\lib\component-normaliz 13% building modules 27/33 modules 6 active ...ue-loader\lib\component-normaliz 13% building modules 28/33 modules 5 active ...ue-loader\lib\component-normaliz 13% building modules 29/33 modules 4 active ...ue-loader\lib\component-normaliz 13% building modules 30/33 modules 3 active ...ue-loader\lib\component-normaliz 13% building modules 31/33 modules 2 active ..._modules\sockjs-client\dist\sock 13% building modules 31/34 modules 3 active ...les\vue-router\dist\vue-router.e 13% building modules 31/35 modules 4 active ...les\html-entities\lib\xml-entiti 13% building modules 31/36 modules 5 active ...s\html-entities\lib\html4-entiti 13% building modules 31/37 modules 6 active ...s\html-entities\lib\html5-entiti 13% building modules 32/37 modules 5 active ...s\html-entities\lib\html5-entiti 13% building modules 33/37 modules 4 active ...s\html-entities\lib\html5-entiti 13% building modules 33/38 modules 5 active ...demo\node_modules\ansi-regex\ind 13% building modules 33/39 modules 6 active ...dong\Desktop\dev\vue-demo\src\Ap 14% building modules 34/39 modules 5 active ...demo\node_modules\ansi-regex\ind 14% building modules 34/40 modules 6 active ...ue-demo\src\components\HelloWorl 14% building modules 35/40 modules 5 active ...demo\node_modules\ansi-regex\ind 14% building modules 35/41 modules 6 active ...dong\Desktop\dev\vue-demo\src\Ap 14% building modules 35/42 modules 7 active ...ue-demo\src\components\HelloWorl 14% building modules 35/43 modules 8 active ...ules\vue-hot-reload-api\dist\ind 14% building modules 36/43 modules 7 active ...ules\vue-hot-reload-api\dist\ind 14% building modules 37/43 modules 6 active ...ules\vue-hot-reload-api\dist\ind 14% building modules 37/44 modules 7 active ...e-style-loader\lib\addStylesClie 14% building modules 38/44 modules 6 active ...e-style-loader\lib\addStylesClie 14% building modules 39/44 modules 5 active ...e-style-loader\lib\addStylesClie 14% building modules 40/44 modules 4 active ...e-style-loader\lib\addStylesClie 14% building modules 41/44 modules 3 active ...e-style-loader\lib\addStylesClie 15% building modules 42/44 modules 2 active ...ue-demo\src\components\HelloWorl 15% building modules 42/45 modules 3 active ...ktop\dev\vue-demo\src\assets\log 15% building modules 43/45 modules 2 active ...ue-demo\src\components\HelloWorl 15% building modules 43/46 modules 3 active ...\vue-style-loader\lib\listToStyl 15% building modules 44/46 modules 2 active ...\vue-style-loader\lib\listToStyl 15% building modules 45/46 modules 1 active ...\vue-style-loader\lib\listToStyl 15% building modules 46/47 modules 1 active ...de_modules\css-loader\lib\css-ba 95% emitting DONE  Compiled successfully in 3755ms19:30:52I  Your application is running here: http://localhost:8081

恭喜,VUE已经成功安装,并运行起来了一个基础项目,算是走到VUE的门口了。


http://www.ppmy.cn/news/406116.html

相关文章

CECT!!!!!!!!!!!!!!!!!!!!

老婆在去年7月份买到了CECT的619F&#xff0c;刚刚买来看着功能挺多&#xff0c;还不错&#xff0c;用了下&#xff0c;反映速度有点慢&#xff0c;不过可以接受&#xff0c;以为自己曾经对国产手机的偏见是错的&#xff0c;结果昨天&#xff0c;老婆打电话过来说手机已经完全不…

C-COT目标跟踪-----连续卷积算子

论文全名&#xff1a;Beyond Correlation Filters: Learning Continuous Convolution Operators for Visual Tracking 论文摘自ECCV 2016&#xff0c;由Martin Danelljan&#xff08;目标跟踪大神&#xff09;、Gustav Hger、Fahad Shahbaz Khan、Michael Felsberg撰写 附上C…

Nacos源码解析(三) - 服务发现

目录 Nacos服务发现实现逻辑 服务端服务发现实现逻辑 总结 Nacos服务发现实现逻辑 com.alibaba.cloud.nacos.discovery.NacosDiscoveryClient#getInstances public List<ServiceInstance> getInstances(String serviceId) {try {// 获取该服务下健康的实例列表return…

【Linux】面试重点:死锁和生产消费模型原理

面试要点来了~ 文章目录 前言一、死锁的一系列问题二、生产者消费者模型原理总结 前言 上一篇的互斥量原理中我们讲解了锁的原理&#xff0c;我们知道每次线程申请锁的时候一旦申请成功这个线程自己就把锁带在自己身上了&#xff0c;这就保证了锁的原子性&#xff08;因为只有…

CECT Q500 手机使用优缺点完全手册

在半年的cect q500使用过程中碰到了好多的问题&#xff0c;这款国产手机的优缺点都是那些&#xff1f; 大家多多交流 首先声明: 以下全部言论乃个人言论,代表个人观点,仅仅是本人以及本人在某些特定的地方,而且使用特定的Q500过程中碰到一些事情,仅仅讲述给大家听听,没有 其…

ECMAScript6中的class关键字

在《JavaScript(13)&#xff1a;创建对象的8种方法》中&#xff0c;我总结了8种创建对象的方法&#xff0c;现在几乎都忘记得差不多了&#xff0c;如果不翻看以前的资料&#xff0c;还真想不起来有那些创建方法&#xff0c;Javascript的语言元素看似不多&#xff0c;但要灵活掌…

【转帖】 深入剖析多普达◆HTC◆CECT◆O2几者之间的关系

每当提起PPC或smartphone智能手机&#xff0c;人们总是首先想起多普达。对&#xff0c;多普达无论是在PPC领域还是smartphone领域给人的影响都是非常深刻的&#xff0c;因为多普达一直专注做智能手机。 关注水货手机的朋友可能已经留意到了&#xff0c;多普达同一款产品总会有很…

区块链网络管理平台WeBASE双节点可视化部署

区块链网络管理平台WeBASE双节点可视化部署 一、管理节点配置Ansible(192.168.56.101)1.安装Ansible2.配置Ansible host_key_checking3.免密登录配置4.配置Ansible Hosts与免密登录5.测试Ansible 二、管理节点部署依赖服务(192.168.56.101)0.Jdk安装1.签名服务&#xff08;WeBA…