Reputation: 1167
I have an existing Laravel project which I created with the following command.
curl -s https://laravel.build/example-app | bash
The project was created successfully and when I start it with command ./vendor/bin/sail up
it works fine.
I want to clone the project on my second machine and start with sail. I found the following link from documentation which gives you possibility to run composer install
even if you don't have composer installed on your OS.
docker run --rm \
-u "$(id -u):$(id -g)" \
-v $(pwd):/var/www/html \
-w /var/www/html \
laravelsail/php81-composer:latest \
composer install --ignore-platform-reqs
This basically starts a docker container which has php and composer installed and runs composer install
.
Installing packages work fine, but whenever I run ./vendor/bin/sail up
then it throws errors and the application is not started.
It looks like some packages were not installed.
Has anyone had the same issue?
Upvotes: 2
Views: 4547
Reputation: 1167
The problem is that you should update laravel/sail
package first and then run composer install.
docker run --rm \
-u "$(id -u):$(id -g)" \
-v $(pwd):/var/www/html \
-w /var/www/html \
laravelsail/php81-composer:latest \
composer update laravel/sail
docker run --rm \
-u "$(id -u):$(id -g)" \
-v $(pwd):/var/www/html \
-w /var/www/html \
laravelsail/php81-composer:latest \
composer install --ignore-platform-reqs
Upvotes: 3