'How do I host Laravel and Inertiajs (React) app in cPanel?
I built a laravel with inertiajs App, Now I'm going to deploy my app to some host.
I tried Siteground to deploy it but it doesn't support NPM!
Now I'm trying to do it with cpannel, Here is my file structure:
And I already connect SSH terminal. there is no issue with laravel installation, but when I do npm install
I'm getting -bash: npm: command not found
Can you help me with some example please!
Solution 1:[1]
In production you don't need to install node modules if you have a production version of your (React app)
i usually use Reactjs in frontend so the process is
yarn build
- take the build version of your app and add it to the root of your server
for Laravel
git clone ******
cp .env.example .env
- edit the .env data to match your production data
- run
composer install
- run
php artisan key:generate
php artisan migrate
- point your server to the public folder with symbolic link for example
your app should now be live.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | M't |