图文详解--亲测有效---Vue-cli3 更新 vue create is a Vue CLI 3 only command and you are using Vue CLI 2.9.6.

Vue-cli3 更新 vue create is a Vue CLI 3 only command and you are using Vue CLI 2.9.6.

2.9.6 初始化项目是用 vue init webpack my-project  3.0以上 初始化项目是用 vue create my-project

这是因为你安装的是2.9的版本用了3.0的命令

解决方法:1.用2.9的命令初始化项目 vue init webpack my-project

             2.卸载2.9升级到3.0

按照提示图文详解--亲测有效---Vue-cli3 更新 vue create is a Vue CLI 3 only command and you are using Vue CLI 2.9.6._第1张图片

按照提示你安装成功的话 你安装成功的是4(因为当前 Vue CLI 的最新版就是 4)   https://github.com/vuejs/vue-cli github上的源码

如果你非要安装 3 的话:

npm i -g @vue/cli@^3.12.1

 

Vue CLI 3需要 nodeJs ≥ 8.9 (官方推荐 8.11.0+,你可以使用 nvm 或 nvm-windows在同一台电脑中管理多个 Node 版本)。

查看node版本

 

更新

1.先执行   卸载掉旧的  确认卸载干净

npm uninstall -g vue-cli

确认卸载干净

图文详解--亲测有效---Vue-cli3 更新 vue create is a Vue CLI 3 only command and you are using Vue CLI 2.9.6._第2张图片

 

卸载不干净的时候以cmd管理员身份运行 鼠标右键

图文详解--亲测有效---Vue-cli3 更新 vue create is a Vue CLI 3 only command and you are using Vue CLI 2.9.6._第3张图片

确保卸载干净然后在继续下一步

图文详解--亲测有效---Vue-cli3 更新 vue create is a Vue CLI 3 only command and you are using Vue CLI 2.9.6._第4张图片

2.安装@vue/cli (Vue CLI 3的包名称由 vue-cli 改成了 @vue/cli) 

cnpm install -g @vue/cli

 

图文详解--亲测有效---Vue-cli3 更新 vue create is a Vue CLI 3 only command and you are using Vue CLI 2.9.6._第5张图片

查看版本 vue --vuesion 

 

/*****安装指定版本*******/

3.0以下    npm install -g vue-cli@版本号

3.0以上   npm install -g @vue/cli@版本号

 

你可能感兴趣的:(vue)