Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 726
Mahdi Toosi Avatar asked Jul 31 '18 13:07

Mahdi Toosi


People also ask

How do I uninstall vue cli plugin?

With the new "vue ui" option, removing installed cli-plugins is supported now. Under "Dependencies" (second tab on the left of vue ui) you'll find all plugins listed. And on the right of each plugin there is a little trash icon, which removes the respective plugin.

How do I install vue 2?

If you are looking for a specific version of Vue2 you can run the following command with npm: npm install [email protected] or if you want the latest, simply npm install vue . Save this answer.


2 Answers

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
like image 66
Kaumadie Kariyawasam Avatar answered Sep 21 '22 12:09

Kaumadie Kariyawasam


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
like image 34
Christian Hernandez Avatar answered Sep 19 '22 12:09

Christian Hernandez