0

Thank you for reading this. Here is the Detailed Info

I am familiar with deploying multiple Laravel Apps. I am trying to deploy a Laravel React App for the first time. Here are the steps I followed

Used Git to push the ready app using following commands

  • git add .
  • git commit -m "initial production commit"
  • git push origin master At the server
  • git clone [git repo url]
  • composer install
  • setup env
  • npm install Now here is the issues it gives me all kind of errors like "peer dependency does not meet" for babel-core, react, react-dom and many more. Then I started to install it manually as after searching on internet I realized it does not install dependencies automatically. Now when I install react 16 it gives me error

requires a peer of react@^15.0.0 but none is installed. You must install peer dependencies yourself.

and when I install react 15 it gives me error for react 16. I have already tried this link : How to deploy react laravel project?

When I push all the code using git push --all -f it pushes everything including configuration and then it works on server.

How do I do it ? Is there any other way to deploy ? what are the right steps to be followed ?

1 Answer 1

1

That's because in 99% of situations your local npm version is different from server npm version however you don't need and ideally you should not install npm into your server because npm and node_modules are for development only and all you need to do is to use compiled js/css file to your project. again it does not necessary to install npm into your server.
Best regards

Sign up to request clarification or add additional context in comments.

2 Comments

how do we use that ? where is that file ? do we have to push it ?
sorry for the late answer, the output path usually is in webpack.mix.js

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.