Reputation: 440
Even after using the npm uninstall command, I still can use the vue command.
christianjavan@rog:~$ sudo npm uninstall vue-cli
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
up to date in 0.781s
found 0 vulnerabilities
christianjavan@rog:~$ vue -V
2.9.2
christianjavan@rog:~$ sudo npm uninstall -g vue-cli
up to date in 0.039s
christianjavan@rog:~$ sudo npm uninstall vue-cli
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
up to date in 0.721s
found 0 vulnerabilities
christianjavan@rog:~$ vue -V
2.9.2
christianjavan@rog:~$ npm update
christianjavan@rog:~$ sudo npm update
christianjavan@rog:~$ vue -V
2.9.2
I already tried to completely remove nodejs and reinstall, but it doesn't seem to work either.
Any ideas on how to remove the vue-cli 2.x.x?
Upvotes: 4
Views: 3152
Reputation: 440
[SOLUTION]
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
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: 2
Reputation: 1756
it looks like you're missing a flag to determine context; maybe try sudo npm uninstall -g vue-cli
(or -S
or -D
as needed)
Upvotes: 0