Deekshant Joshi
Deekshant Joshi

Reputation: 73

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255

I am developing this package: https://github.com/craftisan/laravel-seo as an extension for laravel-admin and while requiring it via composer into a laravel project, I am getting this error (see github issue here):

% composer require craftisan/laravel-seo --ignore-platform-reqs
Using version dev-master for craftisan/laravel-seo
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing craftisan/laravel-seo (dev-master 96e32bc): Cloning 96e32bc192 from cache
Package moontoast/math is abandoned, you should avoid using it. Use brick/math instead.
Package zendframework/zend-code is abandoned, you should avoid using it. Use laminas/laminas-code instead.
Package zendframework/zend-eventmanager is abandoned, you should avoid using it. Use laminas/laminas-eventmanager instead.
Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255

Installation failed, reverting ./composer.json to its original content.

I tried debugging a lot, checked config file syntax, even dumped output all the way from package:discover command in artisan, didn't find anything.

storage/ & bootstrap/cache is writeable
rm -rf bootstrap/cache done

Any ideas why this could be happening?

Upvotes: 1

Views: 2069

Answers (1)

Deekshant Joshi
Deekshant Joshi

Reputation: 73

Fixed

Installed the same package in a fresh laravel application. Apparently the relative link to config file was broken but composer install wasn't giving error trace. Missed preceding / after __DIR__:

// Publish configuration
        $this->publishes([
            __DIR__ . '../config/seo.php' => config_path('seo.php'),
// fix: __DIR__ . '/../config/seo.php' => config_path('seo.php'),
        ], 'seo');

Upvotes: 2

Related Questions