Skip to content

Install Vue.js

Alexis ROLLAND edited this page Feb 3, 2019 · 1 revision

Personal notes to get started with Vue.js.

Install nodejs and npm

nodejs is required to be able to run npm, while npm is required to install vue-cli

$ sudo apt install nodejs npm

Install vue-cli

vue-cli is required to create a project template

$ sudo npm install -g vue-cli

Install project template

webpack-simple is the project template, also install npm dependencies in the project folder

$ vue init webpack-simple foldername
$ cd foldername
$ npm install

Install vue-router

vue-router is required to change vue components based on the URLs and their parameters

$ npm install --save vue-router

Install vue-resource

vue-resource is required to send http requests and use $http object

$ npm install --save vue-resource

Install vuex

vuex is required to manage vue application state (data) in the application store

$ npm install --save vuex

Run web application in dev mode

$ npm run dev

Build web application for prod

$ npm run build