废话少说,当你看到这里的时候我认为你已经浏览过相关的文章了。这也是我自己安装过程的总结。不管是Vue的官方文档还是Vue的菜鸟教程,甚至CSDN博客上面都有许多的安装教程,他们的总结也非常棒。我也把我的安装过程说一说,希望总会有帮助到某个人的那一天。我用的是window系统
总结一下就是:
1 cnpm install --global vue-cli
2 vue init webpack my-project 这里一直默认也行
3 cnpm install 关键是这一步,很多文章、或者教程都会漏掉
4 npm run dev
5 http://localhost:8081 在网上输入这个网址回车,是否成功很明显可以看出来
具体操作下面详细介绍:会花点时间浏览
一、全局安装 vue-cli
window+R打开cmd窗口,然后cd Desktop回车进入到桌面(这一步是可有可无的,我也是图个方便,以后好找)。然后输入cnpm install --global vue-cli。如下所示:
C:\Users\lenovo>cd Desktop
C:\Users\lenovo\Desktop>cnpm install --global vue-cli
cnpm install --global vue-cli在全局安装这个后,他就会在安装好多下面这个东西,英语不怎么好,我也不仔细去翻译了。总之不出现红色报错就没问题
[1/20] commander@^2.9.0 installed at node_modules\[email protected]@commander
[2/20] multimatch@^2.1.0 installed at node_modules\[email protected]@multimatch
[3/20] minimatch@^3.0.0 installed at node_modules\[email protected]@minimatch
[4/20] ora@^1.3.0 installed at node_modules\[email protected]@ora
[5/20] consolidate@^0.14.0 installed at node_modules\[email protected]@consoli
date
[6/20] rimraf@^2.5.0 existed at node_modules\[email protected]@rimraf
[7/20] chalk@^2.1.0 installed at node_modules\[email protected]@chalk
[8/20] semver@^5.1.0 installed at node_modules\[email protected]@semver
[9/20] [email protected] installed at node_modules\[email protected]@uid
[10/20] tildify@^1.2.0 installed at node_modules\[email protected]@tildify
[11/20] read-metadata@^1.0.0 installed at node_modules\[email protected]@read
-metadata
[12/20] user-home@^2.0.0 installed at node_modules\[email protected]@user-home
[13/20] [email protected] existed at node_modules\[email protected]@coffe
e-script
[14/20] validate-npm-package-name@^3.0.0 installed at node_modules\_validate-npm
[email protected]@validate-npm-package-name
[15/20] metalsmith@^2.1.0 installed at node_modules\[email protected]@metalsmith
[16/20] handlebars@^4.0.5 installed at node_modules\[email protected]@handlebars
[17/20] download-git-repo@^1.0.1 installed at node_modules\_download-git-repo@1.
1.0@download-git-repo
[18/20] request@^2.67.0 installed at node_modules\[email protected]@request
[19/20] async@^2.4.0 installed at node_modules\[email protected]@async
[20/20] inquirer@^6.0.0 installed at node_modules\[email protected]@inquirer
deprecate [email protected] › [email protected] › coffee-script@^1.12.4 CoffeeScr
ipt on NPM has moved to "coffeescript" (no hyphen)
Recently updated (since 2019-04-06): 1 packages (detail see file C:\Users\lenovo
\AppData\Roaming\npm\node_modules\vue-cli\node_modules\.recently_updates.txt)
2019-04-10
→ [email protected] › uglify-js@^3.1.4(3.5.4) (13:34:25)
All packages installed (238 packages installed from npm registry, used 2m(networ
k 2m), speed 57.43kB/s, json 223(406.63kB), tarball 4.72MB)
[[email protected]] link C:\Users\lenovo\AppData\Roaming\npm\vue@ -> C:\Users\lenovo
\AppData\Roaming\npm\node_modules\vue-cli\bin\vue
[[email protected]] link C:\Users\lenovo\AppData\Roaming\npm\vue-init@ -> C:\Users\l
enovo\AppData\Roaming\npm\node_modules\vue-cli\bin\vue-init
[[email protected]] link C: