Question

Do I need Node to deploy Laravel Vue SPA

I have just deployed my SPA to a server. I used laravel with vue frontend scaffolding. Now the app is online and if I go to the domain I see it (but it’s not working correctly). However, I did not run npm run production before I deployed to the server.

Should I have run npm run production before I deployed? Is it too late to do it now? Should I do it on the server or should I do it only local device and then push? Is npm run production even necessary for a a laravel app with vue frontend?

I currently do not have node on the server. The server is setup as a LEMP stack (Linux, Nginx, MySQL, PHP 7.3).

Thanks in advance.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

HI nj167252. It looks you deployed a laravel vue project with git. I am new to everything. Please recommend me any tutorials or resorces.

Thank YOU!

Regards ynav

No, node.js is not required in your cases.

I am agreeing with bobby because you just need to upload required files on the server with package.json file and then install the node packages using npm install and then create a production version of code using npm run production and your project should be working.

Please careful with environment files because it consists of sensitive data. Otherwise, you are good to go.

Hi there @nj167252,

Node should not really be required in this case. What is the exact error that you get?

I would recommend running npm run production after the deployment, this should build your JS files.

Regards, Bobby