Vue-Cli 环境安装

一、安装Vue

1.1 设置 npm 仓库位置为淘宝仓库

# 因为 npm 默认配置的远程仓库为国外地址,在国内会出现卡顿或连不上的情况,故配置为国内淘宝 NPM
程仓库地址
D:\Works\vueworkspace> npm config set registry http://registry.npm.taobao.org

1.2 查看 npm 仓库配置 

# 查看 npm 仓库配置
D:\Works\vueworkspace> npm config list
; cli configs
metrics-registry = "http://registry.npm.taobao.org/"
scope = ""
user-agent = "npm/6.13.4 node/v10.15.3 win32 x64"
; userconfig C:\Users\LILIBO\.npmrc
registry = "http://registry.npm.taobao.org/"
; builtin config undefined
prefix = "C:\\Users\\LILIBO\\AppData\\Roaming\\npm"
; node bin location = C:\Program Files\nodejs\node.exe
; cwd = D:\Works\vueworkspace
; HOME = C:\Users\LILIBO
; "npm config ls -l" to show all defaults.

1.3 查看 Vue 本地安装的版本

# 查看 Vue 本地安装的版本
D:\Works\vueworkspace> vue -V
2 .9.6 # Vue3.0 以后的版本显示为 @vue/cli x.x.x
# 未安装 Vue 时出现以下提示
'vue' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

1.4 查看 Vue 远程仓库可用版本 

# 查看 Vue3.0 之前的版本
D:\Works\vueworkspace> npm view vue-cli versions --json
[
"1.0.0" ,
"1.0.1" ,
"1.0.2" ,
"1.0.3" ,
"1.1.0" ,
"1.1.1" ,
"1.1.2" ,
"1.1.3" ,
"1.2.0" ,
"1.3.0" ,
"1.4.0" ,
"2.0.0" ,
"2.0.1" ,
"2.0.2" ,
"2.0.3" ,
"2.0.4" ,
"2.1.0" ,
"2.1.1" ,
"2.2.0" ,
"2.3.1" ,
"2.4.0" ,
"2.5.0" ,
"2.5.1" ,
"2.6.0" ,
"2.7.0" ,
"2.8.0" ,
"2.8.1" ,
"2.8.2" ,
"2.9.0" ,
"2.9.1" ,
"2.9.2" ,
"2.9.3" ,
"2.9.4" ,
"2.9.5" ,
"2.9.6"
]
# 查看 Vue3.0 之后的版本
D:\Works\vueworkspace> npm view @vue/cli versions --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.12.1" ,
"4.0.0-alpha.0" ,
"4.0.0-alpha.1" ,
"4.0.0-alpha.2" ,
"4.0.0-alpha.3" ,
"4.0.0-alpha.4" ,
"4.0.0-alpha.5" ,
"4.0.0-beta.0" ,
"4.0.0-beta.1" ,
"4.0.0-beta.2" ,
"4.0.0-beta.3" ,
"4.0.0-rc.0" ,
"4.0.0-rc.1" ,
"4.0.0-rc.2" ,
"4.0.0-rc.3" ,
"4.0.0-rc.4" ,
"4.0.0-rc.5" ,
"4.0.0-rc.6" ,
"4.0.0-rc.7" ,
"4.0.0-rc.8" ,
"4.0.0" ,
"4.0.1" ,
"4.0.2" ,
"4.0.3" ,
"4.0.4" ,
"4.0.5" ,
"4.1.0-beta.0" ,
"4.1.0" ,
"4.1.1" ,
"4.1.2" ,
"4.2.0" ,
"4.2.1" ,
"4.2.2" ,
"4.2.3" ,
"4.3.0" ,
"4.3.1" ,
"4.4.0" ,
"4.4.1" ,
"4.4.2" ,
"4.4.3" ,
"4.4.4" ,
"4.4.5" ,
"4.4.6" ,
"4.5.0" ,
"4.5.1" ,
"4.5.2" ,
"4.5.3" ,
"4.5.4" ,
"4.5.5" ,
"4.5.6" ,
"4.5.7" ,
"4.5.8" ,
"4.5.9" ,
"4.5.10" ,
"4.5.11" ,
"4.5.12" ,
"4.5.13" ,
"5.0.0-alpha.0" ,
"5.0.0-alpha.1" ,
"5.0.0-alpha.2" ,
"5.0.0-alpha.3" ,
"5.0.0-alpha.4" ,
"5.0.0-alpha.5" ,
"5.0.0-alpha.6" ,
"5.0.0-alpha.7" ,
"5.0.0-alpha.8" ,
"5.0.0-beta.0" ,
"5.0.0-beta.1" ,
"5.0.0-beta.2" ,
"5.0.0-beta.3"
]

1.5 卸载本地已安装的 Vue  

# 卸载 Vue3.0 之前的版本使用
D:\Works\vueworkspace> npm uninstall -g vue-cli
removed 236 packages in 1 .683s
# 卸载 Vue3.0 之后的版本使用
D:\Works\vueworkspace> npm uninstall -g @vue/cli
removed 931 packages in 5 .826s

1.6 安装 Vue 最新版本 

# 自动安装最新版本的 Vue ,将会通过网络下载并安装
D:\Works\vueworkspace> npm i @vue/cli -g
npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'
npm WARN deprecated request@2.88.2: request has been deprecated, see
https://github.com/request/request/issues/3142
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no
longer supported or maintained
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no
longer supported or maintained
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated graphql-tools@4.0.8: This package has been deprecated and
now it only exports makeExecutableSchema.\nAnd it will no longer receive
updates.\nWe recommend you to migrate to scoped packages such as @graphql-
tools/schema, @graphql-tools/utils and etc.\nCheck out https://www.graphql-
tools.com to learn what package you should use instead
npm WARN deprecated graphql-extensions@0.15.0: The API has been removed from
Apollo Server 3 . Use the plugin API instead:
https://www.apollographql.com/docs/apollo-server/integrations/plugins/
C:\Users\LILIBO\AppData\Roaming\npm\vue - >
C:\Users\LILIBO\AppData\Roaming\npm\node_modules\@vue\cli\b in \vue.js
> core-js-pure@3.16.3 postinstall
C:\Users\LILIBO\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\core-js-
pure
> node -e "try{require('./postinstall')}catch(e){}"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for
polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js:
> https://opencollective.com/core-js
> https://patreon.com/zloirock
> https://paypal.me/zloirock
> bitcoin: bc1qlea7544qtsmj2rayg0lthvza9fau63ux0fstcz
Also, the author of core-js ( https://github.com/zloirock ) is looking for a
good job - )
> @apollo/protobufjs@1.2.2 postinstall
C:\Users\LILIBO\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\@apollo\p
rotobufjs
> node scripts/postinstall
> ejs@2.7.4 postinstall
C:\Users\LILIBO\AppData\Roaming\npm\node_modules\@vue\cli\node_modules\ejs
> node ./postinstall.js
Thank you for installing EJS: built with the Jake JavaScript build tool
(https://jakejs.com/)
npm WARN ws@7.5.3 requires a peer of bufferutil@^4.0.1 but none is installed.
You must install peer dependencies yourself.
npm WARN ws@7.5.3 requires a peer of utf-8-validate@^5.0.2 but none is
installed. You must install peer dependencies yourself.
+ @vue/cli@4.5.13
added 931 packages from 584 contributors in 47 .653s

1.7 安装完毕,查看版本信息 

# 查看 Vue 版本
D:\Works\vueworkspace> vue -V
@vue/cli 4 .5.13

至此,Vue 安装完成

 

 

 

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值