How to install Vue.js

May 30, 2022

It’s trivial to install Vue.js in your Laravel project if it’s missing.

Installing latest Vue

First check if you already have Vue.js installed:

$ ls node_modules/vue

If it’s not there, use npm to install it easily:

$ npm i vue

Now include it in your main (entrypoint) JS file, eg resources/assets/js/app.js:

import Vue from 'vue'

Voila, you can use Vue in your Laravel project now!

Published by Laravel & Vue.js who lives and works in Sydney building useful things.