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-cliappears 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)

Most upvoted comments

It seems you have multiple installations of vue-cli.

What is the output of:

vue --version
npm uninstall -g vue-cli
yarn global remove vue-cli
vue --version

?

Find out where it is which vue

I deleted my node_modules folder and package.json in ~/.config/yarn/global then installed with yarn global add @vue/cli worked for me

I’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:

npm ls -g --depth=0
nvm use system
npm uninstall -g vue-cli

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. Ran npm 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:

C:\Users\Imdad Ali\AppData\Local\Yarn\Data\global\node_modules\vue-cli

From the file:

C:\Users\Imdad Ali\AppData\Local\Yarn\Data\global\package.json

Delete the line:

“vue-cli”: “2.9.6”,

Then in your terminal, run the cmd:

yarn global add @vue/cli@latest

It seems you have multiple installations of vue-cli.

What is the output of:

vue --version
npm uninstall -g vue-cli
yarn global remove vue-cli
vue --version

?

vue-cli.jpg