【Mac电脑卸载vue/cli@2.9.6失败】vue create is a Vue CLI 3 only command and you are using Vue CLI 2.9.6.

vue create is a Vue CLI 3 only command and you are using Vue CLI 2.9.6.
You may want to run the following to upgrade to Vue CLI 3:

问题

  1. vue crete项目时提示 应该升级vue/cli 2.9.6版本
beiluo@beiluodeMBP vue-cli % vue create vue_demo

  vue create is a Vue CLI 3 only command and you are using Vue CLI 2.9.6.
  You may want to run the following to upgrade to Vue CLI 3:

  npm uninstall -g vue-cli
  npm install -g @vue/cli

beiluo@beiluodeMBP vue-cli % vue -V
2.9.6
beiluo@beiluodeMBP vue-cli % npm install -g @vue/cli
  1. 执行卸载重装版本发现没有用,依然是vue/cli 2.9.6版本

npm uninstall -g vue-cli

npm install -g @vue/cli

beiluo@beiluodeMBP vue-cli % npm uninstall -g vue-cli

up to date, audited 1 package in 96ms

found 0 vulnerabilities
beiluo@beiluodeMBP vue-cli % vue -V
2.9.6
beiluo@beiluodeMBP vue-cli % npm install -g @vue/cli
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated subscriptions-transport-ws@0.11.0: The `subscriptions-transport-ws` package is no longer maintained. We recommend you use `graphql-ws` instead. For help migrating Apollo software to `graphql-ws`, see https://www.apollographql.com/docs/apollo-server/data/subscriptions/#switching-from-subscriptions-transport-ws    For general help using `graphql-ws`, see https://github.com/enisdenjo/graphql-ws/blob/master/README.md

changed 848 packages in 18s
beiluo@beiluodeMBP vue-cli % vue -V
2.9.6
beiluo@beiluodeMBP vue-cli % 


解决方案

1执行命令,查看vue存在路径

which vue

beiluo@beiluodeMBP vue-cli % which vue
/usr/local/bin/vue
beiluo@beiluodeMBP vue-cli % 
2.进入目录

cd /usr/local/bin

beiluo@beiluodeMBP vue-cli % cd /usr/local/bin    
beiluo@beiluodeMBP bin % 
3.卸载删除vue,安装完毕查看vue版本

(1)执行 rm -rf vue卸载删除vue
(2)执行vue -V查看版本
(3)可能需要重新安装,执行 npm install -g @vue/cli 命令

beiluo@beiluodeMBP bin % rm -rf vue

beiluo@beiluodeMBP vue-cli % vue -V
@vue/cli 5.0.8
  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值