Harris Khan
Harris Khan

Reputation: 265

How to upgrade Vue version

I was using the Vue version (2.5), I ran that command npm install -g @vue/cli after that I check my vue version by using the command vue --versionand it shows me @vue/cli 4.1.2. but in my package.json file the version did not upgrade, it still showing me the older version i.e 2.5.7. enter image description here

Any help would be highly appreciable

Upvotes: 15

Views: 77839

Answers (6)

Amr Omar
Amr Omar

Reputation: 555

You can use this guide to upgrade to Vue 2.7: Vue 2.7 Migration Guide

Upvotes: 2

Chadi
Chadi

Reputation: 787

You can use npx to avoid installing the @vue/cli package globally.

npx --legacy-peer-deps @vue/cli upgrade

Upvotes: 0

Theakash
Theakash

Reputation: 203

You can upgrade it through vue cli.

yarn global add @vue/[email protected]

OR

npm i -g @vue/[email protected]

then

vue upgrade

Upvotes: -2

Ilank
Ilank

Reputation: 87

Both provided answers assume you have a project and you're updating it. If you want to update the global installation, as per the documentation in the Vue website at https://cli.vuejs.org/guide/installation.html you need to do the following:

npm update -g @vue/cli

Upvotes: 3

Dhara Parmar
Dhara Parmar

Reputation: 293

npm install -g @vue/cli --save

--save will automatically update version in your package.json file.

Upvotes: -13

habib
habib

Reputation: 483

You can upgrade it through vue cli.

npm install -g @vue/cli

OR

yarn global add @vue/cli

then

vue upgrade

Upvotes: 27

Related Questions