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.

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.

×
3 answers

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

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 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

Submit an Answer