Home » vue » How can I set up Vue.js in my Laravel Project ?

How can I set up Vue.js in my Laravel Project ?

Posted by: admin November 26, 2021 Leave a comment

Questions:

I work with Laravel and I try to do something with Vue.js but I can’t see it up.

First of all I install Node.js and npm.
Now I’m trying to user ‘npm run watch’. To see if my js code runs on my laravel project.

But, when I type ‘npm run watch’ in my cmd. It’s like this:

enter image description here

What should I do ?

Thanks !

Answers:

It looks like your version of Laravel Mix is out-of-date; there was a bug fixed in March 2017 that addressed this issue on newer versions of webpack.

You can update your version of Laravel Mix by either doing this:

npm uninstall laravel-mix && npm install --save-dev laravel-mix

or updating your package.json file to change the version for laravel-mix

...
"devDependencies": {
    ...
    "laravel-mix": "^0.11.4",
    ...
}
...

After changing the version number, run npm update.