vue-cli: Cannot update vue-cli from 2.9.6 to latest
Version
2.9.6
Node and OS info
npm 6.4.1
Steps to reproduce
See this screenshot for full output
Install vue-cli
at version 2.9.6
Following steps to update:
$ npm uninstall -g vue-cli
$ npm install -g @vue/cli
vue-cli
appears to be updated based on npm
’s output.
Attempt to make a new project:
$ vue create myproject
What is expected?
A new project is created
What is actually happening?
Vue tells me that create
is a v3 command only, and to upgrade.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 18 (2 by maintainers)
It seems you have multiple installations of
vue-cli
.What is the output of:
?
Find out where it is
which vue
I deleted my node_modules folder and package.json in
~/.config/yarn/global
then installed withyarn global add @vue/cli
worked for meI’ve got this problem when using NVM (node version manager). When you install a package globally, it’s usually installed on the systems node version. Try list installed packages of current version, when not found, switch to “system” and remove package:
https://stackoverflow.com/questions/47763783/cant-uninstall-global-npm-packages-after-installing-nvm#answer-47849940
useing a explicit version helped me, e.g.
npm i -g @vue/cli@v3.5.5
On Linux with version 2.9.6 of Vue, uninstall did not work. I ended up running
which vue
, then deleting the vue executable, along with 2 other vue files in that folder. Rannpm install -g @vue/cli
and all is well.Using Yarn
After spending a long hour trying to figure this out, this is how I fixed it:
Delete the folder:
From the file:
Delete the line:
Then in your terminal, run the cmd: