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

iGenezys's avatar

Deploy Vue JS app with laravel back-end

Hi people,

I recently started to learn Vue JS, and I created a little reply system with laravel for the back-end. That's working locally, I created my laravel app, I installed node JS, went npm run watch and it's fine. But I'd like to put it in my server.

Usually, with only Laravel app, it's working, I can create the project, put the files and eveything works fine. But now I have some vue components, and I don't know what to do on my server.

Actually I created my laravel App on the server, didn't installed Node yet, I put my files on the project, the vue components are in the resources/js/components folder, when I go on my URL, I only have the welcome Laravel page, even if the welcome.blade.php file is modified and have all my components inside.

Should I install NodeJS ? Something else on my server for making it works ?

Since I'm still beginning, I'm a bit afraid to install too many things on my server that I should not do, and I don't really understands all the tutorials I found on the web.

If you can help me getting my app working, I thank you in advance !

0 likes
4 replies
kevinblank's avatar

You don't need NodeJS on a production server for that. Have you pushed your generated js file to the server?

iGenezys's avatar

What do you mean by my "generated js file" ?

If it's the app.js created in the resource folder that create the vue application and register my vue components, then yes, I pushed it in the resources/js folder.

If it's the whole node_modules that was created by the npm install, then no (since I didn't installed nodeJS)

I remember that I installer laravel/ui via composer for my Vue installation, do I need to do this on my server app ?

kevinblank's avatar
Level 20

I assume that you have a standard laravel 6.x setup in place with webpack, right? So, when you run npm run watch webpack compiles all your js stuff to one single app.js (depends on your config), which is located under 'public/js/'. This file is loaded by your application to run all that VueJs stuff. So you need this 'public/js/app.js' file on your server.

iGenezys's avatar

Edit : I finally understood what was the problem, I didn't made de good call on my welcome view. But thanks to you I understand quite better where I need to pay attention with vue + laravel !

Oh I see, then yes this file is already in my public/js folder

I can show you the page at http://labo.tloading.fr/laravue/public/ you'll see that vue is not detected, it's like I miss something elsewhere

Please or to participate in this conversation.