Vaidikalaya

Vue Installation Using CLI

Install CLI

NOTE: If you want to install vue using CLI then first you need to install node and npm in your system.

  • Vue CLI (Command Line Interface) is a globally installed npm package and provides the vue command in your terminal.

STEP 1: How to Install

Open CMD (command prompt) and run given command. It will install Vue CLI globally in your system and then you will able to create vue project using cli. it will give you a proper directory structure where you manage your code easily.

npm install -g @vue/cli
# OR
yarn global add @vue/cli

Upgrading CLI

  If your have already have vue cli and you want to update it than run this command for upgrading vue cli.

npm update -g @vue/cli
# OR
yarn global upgrade --latest @vue/cli

STEP 2: Check cli installed or not

Run vue --version command. If it shows vue version then it mean vue successfully installed in your system otherwise not.

vue --version

STEP 3: Create Vue Project

 After installing vue cli, run this command for creating vue project. It will create vue project with proper directory structure.

vue create < project-name >
#
vue create first-app

STEP 4: Run Created App

After creating vue project run this command for to run vue project

npm run serve
# OR
yarn serve

How to Uninstall Vue CLI

If you want to uninstall vue cli then run this command. It will uninstall cli from your system.

npm uninstall -g @vue/cli