Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code -1073741819
Asked Answered
L

6

9

I got some weird error code after I pulled a project out of my github. My first things I do is composer dumpautoload, composer update, and php artisan migrate:fresh --seed whenver I get to a new terminal. This time, I'm stuck at dumpautoload as it generates this error.

Here's what composer update generated

Loading composer repositories with package information
The "https://repo.packagist.org/packages.json" file could not be downloaded: SSL: An existing connection was forcibly closed by the remote host.

send of 158 bytes failed with errno=10054 An existing connection was forcibly closed by the remote host.

failed to open stream: HTTP request failed! 
https://repo.packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date
Updating dependencies (including require-dev)
Nothing to install or update
Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: awobaz/compoships
Discovered Package: facade/ignition
Discovered Package: fideloper/proxy
Discovered Package: intervention/image
Discovered Package: laravel/tinker
Discovered Package: laravel/ui
Discovered Package: maatwebsite/excel
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Discovered Package: spatie/laravel-medialibrary
Discovered Package: yajra/laravel-datatables-oracle
Package manifest generated successfully.
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error
code -1073741819
Lift answered 11/3, 2020 at 10:47 Comment(6)
try php artisan clear and see what error you get so you know what file is causing the errorSenhor
execute php artisan clearManhood
execute php artisan dump-autoload to clear all logsMulry
All didnt work, produced the same error code.Lift
When you try to execute php artisan migrate:fresh --seed your data in the database will be lost. Make sure on that point before useLiber
@MangalaKarunarathne this was a development project in 2020, and yes I do fresh and seed on a local serverLift
V
18

Old (cached) local dependencies or composer.lock file may causes problem like this. You can try to reinstall all dependencies after remove all dependencies and lock file.

To remove downloaded dependencies, execute this inside app base dir;

sudo rm -rf vendor/

after that delete composer.lock file by executing;

sudo rm composer.lock

and finally execute;

composer install
Vesper answered 11/3, 2020 at 11:34 Comment(3)
took me a year to understand this sets of code. I work on a Windows platform and the first thing when I saw this last year was why it doesnt work on the command lineLift
I have been searching for a sol for months. This worked for me.Ullund
this solution make senseSinglehandedly
M
0

To resolve this, configure composer to use the https repository by running the following command on the cli before installing Laravel

composer config -g repo.packagist composer https://packagist.org
Manhood answered 11/3, 2020 at 11:1 Comment(5)
First didn't work. Second, was using local already. Last, also didn't work.Lift
Now you added the composer error. To solve this run composer config -g repo.packagist composer https://packagist.orgManhood
the repo was fixed but the post-autoload-event persistsLift
if you cloned a project from github, the first thing is to run cp .env.example .env Then run composer install againManhood
Also check the content of config/databse.phpManhood
L
0

enter image description here

Just delete the vendor directory and install the composer again composer install

Liber answered 24/11, 2022 at 8:19 Comment(0)
C
-1

Try to create a new laravel project, and use the new files under the storage/ & bootstrap/cache to replace the files in the original folders.

Celtuce answered 23/6, 2021 at 2:51 Comment(0)
E
-1

I had the same issue and tried re-establishing the dependancies but this did not work for me. It turned out that it was the DB schema causing the issue. More specifically - I had a legacy table named settings. Once I renamed this table and followed up with composer install, the problem was solved. I think this is due to a spatie package that creates a settings table for itself.

Esquivel answered 6/9, 2022 at 10:30 Comment(0)
C
-1

For me, I had to run this command: mkdir -p bootstrap/cache. Basically, create this folder in order for it to run.

Croydon answered 15/9 at 15:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.