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 ?

Nilkamal Gotarne
  • 335
  • 5
  • 16

1 Answers1

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

AH.Pooladvand
  • 1,944
  • 2
  • 12
  • 26