lnmput
lnmput

Reputation: 51

how to use vue-cli install the other vue version not latest

I want to use vue-cli to initialize my vue project, but the vue and wepack version is the latest, This is not what I want, The older version is what I want, So I want to know how to install other versions of vue or webpack using vue-cli not the latest, Thanks!

Upvotes: 5

Views: 18747

Answers (2)

Syed
Syed

Reputation: 16513

I am assuming this is because you have installed latest vue-cli which is currently 3.0.0-beta.10 and vue init is no longer the standard way of initiating new project.

So, in your scenario, for v3 version you should use: vue create test-app.

Though if you still like to use vue init then do either of it:

  • See if things can work by doing what is suggested by @RuChernChong (I have not tried it)
  • Or, just reinstall the old vue-cli by just running npm install -g [email protected],

Side Note: You may need delete latest v3 manually if above mentioned suggestions doesn't work. Just run which vue you will find where v3 is installed and delete it manually and then run npm install -g [email protected]. Hope this should help.

Other places you can find help:

  • Check kinda related question here
  • Or, check how to use new v3 CLI here

Upvotes: 4

Ru Chern Chong
Ru Chern Chong

Reputation: 3756

Use the command vue init <template> <project-name>

If you want to build using the webpack template, then

vue init webpack webpack-example

Depending on your current system, you might have to install an additional package for the above command to work.

npm install --global vue-init

Upvotes: 1

Related Questions