Vue.js | Introduction & Installation
This guide is for Vuejs version 2
Installation of VueJS: The VueJs can be used in three different ways those are listed below:
- Directly included CDN file.
- Install through the npm.
- Using CLI
Note: add sudo before every command while using Linux based operating systems and Mac operating systems in order to avoid storage permissions.
- For learning purpose, you can use below script(with the specific version):
- For production purposes, you can use below script:
- For ES modules compatible, use below script:
import Vue from ‘https://firstname.lastname@example.org/dist/vue.esm.browser.js’
Install through the npm: Before applying this procedure you must have installed npm, to check npm installed or not run the below command:
If not, you can install that through node.js installation procedure for:
Now you are ready to install the VueJS, to do so run the below command. It will install the most updated stable version of VueJS.
npm install vue
Using CLI: Open your terminal or command prompt and run the below command.
npm install -g @vue/cli
Let’s create a project through CLI:
- Step 1: Run the below command to create the project.
vue create myproject
- Step 2: Now get into the myproject folder by using below command.
- Step 3: Run the below command to run your project locally.
npm run dev