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

abduljakul-salsalani's avatar

how to fix Vue packages version mismatch error

I am not good with npm commands maybe I could use some help from you.

How can i downgrade vue-template-compiler ?

Vue packages version mismatch:

This may cause things to work incorrectly. Make sure to use the same version for both. If you are using vue-loader@>=10.0, simply update vue-template-compiler. If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.

0 likes
4 replies
neilherbertuk's avatar

You can change the version number by editing your packages.json file and re-running npm install

neilherbertuk's avatar

I would assume that both entries you mention need to be the same. Change Vue to 2.5.16.

saluei's avatar

I use vit and problem solved. this is my package. json

{
    "private": true,
    "scripts": {
        "dev": "vite",
        "build": "vite build"
    },
    "devDependencies": {
        "laravel-vite-plugin": "^0.7.2",
        "@popperjs/core": "^2.11.6",
        "@vitejs/plugin-vue": "^4.0.0",
        "axios": "^1.1.2",
        "bootstrap": "^5.2.3",
        "cross-env": "^7.0",
        "jquery": "^3.2",
        "laravel-mix": "^5.0.1",
        "lodash": "^4.17.19",
        "popper.js": "^1.12",
        "resolve-url-loader": "^3.1.0",
        "sass": "^1.56.1",
        "sass-loader": "^8.0.0",
        "vue-template-compiler": "^2.7.14"
    },
    "dependencies": {
        "vue": "^3.2.36",
        "vue-loader": "^17.0.1"
    }

and vit.config.js

import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import vue from '@vitejs/plugin-vue';

export default defineConfig({
    plugins: [
        vue(),
        laravel([
            'resources/css/app.css',
            'resources/js/app.js'
        ]),
    ],
});

npm install & npm run dev execute without error.

Please or to participate in this conversation.