简体   繁体   中英

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

我想使用vue-cli初始化我的vue项目,但是vue和wepack版本是最新的,这不是我想要的,较旧的版本是我想要的,所以我想知道如何安装vue的其他版本或使用vue-cli的webpack不是最新的,谢谢!

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

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 vue-cli@2.9.3 ,

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 vue-cli@2.9.3 . Hope this should help.

Other places you can find help:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM