Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

afoysal's avatar

How to install VueJS in Laravel 8

I am trying to install VueJS in Laravel. I am getting below error if I run npm run dev.

error

0 likes
13 replies
Sinnbeck's avatar

The error is due to bootstrap not vue. My guess is that you are using an older version of bootstrap. Try upgrading it

1 like
afoysal's avatar

@Sinnbeck Thanks. Here is my package.json.

{
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "mix",
        "watch": "mix watch",
        "watch-poll": "mix watch -- --watch-options-poll=1000",
        "hot": "mix watch --hot",
        "prod": "npm run production",
        "production": "mix --production"
    },
    "devDependencies": {
        "@popperjs/core": "^2.10.2",
        "axios": "^0.21",
        "bootstrap": "^5.1.3",
        "laravel-mix": "^6.0.6",
        "lodash": "^4.17.19",
        "postcss": "^8.1.14",
        "resolve-url-loader": "^3.1.2",
        "sass": "^1.32.11",
        "sass-loader": "^11.0.1",
        "vue": "^2.6.12",
        "vue-loader": "^16.8.3",
        "vue-template-compiler": "^2.6.12"
    },
    "dependencies": {
        "babel-preset-es2015": "^6.24.1",
        "vue": "^3.2.45"
    }
}

afoysal's avatar

@Sinnbeck Thanks . I used both npm update and npm i bootstrap. But I am getting same error as like before. Thanks.

Sinnbeck's avatar

@afoysal Try changing it in the package.json

        "bootstrap": "^5.2",

and run npm update

1 like
Sinnbeck's avatar

So for now just fix the other error and wait for an update. Its in prayer_time.vue where you refernce styles on an empty object

1 like
afoysal's avatar

@Sinnbeck Thanks. Here is my prayer_time.vue .

<template>
    <div>Welcome</div>
</template>
<script>
    export default {
        mounted() {
            console.log("Example component mounted");
        }
    };
</script>

Please or to participate in this conversation.