Mahdi Toosi
Mahdi Toosi

Reputation: 395

How can I remove vue cli 2?

I want to create a vue project with @vue/cli .

As you know vue/cli update to version 3.

Document says vue doc and I'm in ubuntu 17.10 , try to remove vue-cli with npm uninstall vue-cli -g .

But in the terminal I'm only still have access to vue-cli command.

And with vue --version still got steel 2.8.2.

Upvotes: 15

Views: 46308

Answers (11)

Kaumadie Kariyawasam
Kaumadie Kariyawasam

Reputation: 1476

I was able to uninstall using the steps below

step 1 -> using 'which vue' commond to saw where vue was installed.

ex -:

kaw@kaw-HP-Notebook:~/script1/Hutch OPS/vue1$ which vue
/usr/local/bin/vue

step 2-: go to vue installed location

ex -: cd /usr/local/bin

step 3-: Now use following commands to uninstalled the vue

sudo rm -rf vue
sudo rm -rf vue-init
sudo rm -rf vue-list

Upvotes: 2

FEO
FEO

Reputation: 1

sudo npm uninstall -g vue-cli
which vue
>> /usr/local/bin/vue
sudo rm /usr/local/bin/vue*
sudo npm install -g @vue/cli
vue --version
>> @vue/cli 4.2.3

Upvotes: 0

ADARSH SINGH
ADARSH SINGH

Reputation: 1

uninstall it first with :- $ npm uninstall vue-cli -g or yarn global remove vue-cli

Install it again using :- $ npm install -g @vue/cli@latest

Upvotes: 0

Stephen Paul
Stephen Paul

Reputation: 39025

I don't know if this will help anyone but

  • To uninstall 2.x I had to:

    npm uninstall -g vue-cli
    
  • To upgrade to 3.x:

    npm install -g @vue/cli
    

Upvotes: 6

Edgar Farias
Edgar Farias

Reputation: 11

On Windows:

Just find out where your vue is located through the command:

which vue

Then delete all files with prefix 'vue' (e.g. vue-client, vue.cmd). After that type 'which vue' again and note that the path was changed.

Then, if necessary, install @vue/cli again:

npm i @vue/cli -g

Upvotes: 1

Max
Max

Reputation: 35

sudo npm uninstall @vue/cli -g

Upvotes: 2

Amit Bhagat
Amit Bhagat

Reputation: 4300

I installed NodeJs in a folder and set the path in Environmental Variable to use as normal user ( without Admin rights for setup).

Later when I installed NodeJS using setup along with latest NPM and Vue-Cli, I had to remove the path entry that i set previously to make latest installation effective.

Upvotes: 0

shaikh
shaikh

Reputation: 13

At node v10.10.0 and npm 6.4.1 , the following command updated my vue version to 3.4.0

sudo npx npm install -g @vue/cli

Upvotes: 0

groksrc
groksrc

Reputation: 3025

I use nvm to switch between node versions. In my case I had installed vue-cli on the system node and that had been symlinked to /usr/local/bin/vue

To fix:

nvm use system
npm uninstall -g vue-cli

At this point which vue should return vue not found. In that case you can nvm use your desired version and it should run out of that version's directory.

Upvotes: 15

Christian Hernandez
Christian Hernandez

Reputation: 440

I solved the same issue you have (or had), I don't know if you already solved it but here is how I solved it.

using which vue I saw where vue was installed.

christianjavan@rog:$ which vue
/usr/bin/vue

Then I deleted all vue files inside the installation folder

christianjavan@rog:/usr/bin$ sudo rm -rf vue
christianjavan@rog:/usr/bin$ sudo rm -rf vue-init
christianjavan@rog:/usr/bin$ sudo rm -rf vue-list

Then I did exactly what it says in this link.

christianjavan@rog:/$ mkdir ~/.npm-global
mkdir: cannot create directory ‘/home/christianjavan/.npm-global’: File exists
christianjavan@rog:/$ npm config set prefix '~/.npm-global'
christianjavan@rog:/$ export PATH=~/.npm-global/bin:$PATH
christianjavan@rog:/$ source ~/.profile

Then I tried to install the new vue cli

christianjavan@rog:/$ npm install -g @vue/cli

Then I did vue --version and finally got the 3.0.3 version installed

christianjavan@rog:/$ vue --version
3.0.3

I really hope this helps.

NOTE: After trying to run vue -V again later, it did't found the vue command, so I exported the new vue directory to the PATH. When you run npm install -g @vue/cli the command gives you the new vue directory.

christianjavan@rog:~$ npm install -g @vue/cli
/home/christianjavan/.npm-global/bin/vue -> /home/christianjavan/.npm-global/lib/node_modules/@vue/cli/bin/vue.js

You add that directory to your PATH.

christianjavan@rog:~$ export PATH=$PATH:/home/christianjavan/.npm-global/bin

Upvotes: 24

Jose Fanjul
Jose Fanjul

Reputation: 339

Edit, I thought your problem was that you did not know how to uninstall vue-cli 3:

  1. Uninstall it globally: npm uninstall -g vue-cli
  2. Remove local node_modules / npm uninstall vue-cli
  3. Try reinstall if you want

Upvotes: 1

Related Questions