Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package "spatie/laravel-ray" is not installed #153

Closed
brmn opened this issue Feb 10, 2021 · 14 comments
Closed

Package "spatie/laravel-ray" is not installed #153

brmn opened this issue Feb 10, 2021 · 14 comments

Comments

@brmn
Copy link

brmn commented Feb 10, 2021

I have fresh laravel 8 installation with some spatie packages and get

Package "spatie/laravel-ray" is not installed

And i dont want it to be installed

Why do i get this?

@brmn
Copy link
Author

brmn commented Feb 10, 2021

add this to composer.json to disable this shitty package
"extra": {
"laravel": {
"dont-discover": [
"spatie/laravel-ray"
]
}
},

@patinthehat
Copy link
Contributor

@brmn Can you provide some details about your configuration? Or better yet, a small sample repo that replicates the issue?

@freekmurze
Copy link
Member

@brmn also, we aim to have a positive atmosphere on this issue tracker. We don't tolerate any rudeness, so I would appreciate you communicating any issues or remarks in a constructive way 👍

@brmn
Copy link
Author

brmn commented Feb 10, 2021

my composer.json
{ "name": "laravel/laravel", "type": "project", "description": "The Laravel Framework.", "keywords": [ "framework", "laravel" ], "license": "MIT", "require": { "php": "^7.4|^8.0", "andreskrey/readability.php": "^2.1", "fabpot/goutte": "^4.0", "fideloper/proxy": "^4.4", "fruitcake/laravel-cors": "^2.0", "guzzlehttp/guzzle": "^7.0.1", "laravel/framework": "^8.12", "laravel/tinker": "^2.5", "sentry/sentry-laravel": "^2.2", "simpod/clickhouse-client": "^0.3.0", "smi2/phpclickhouse": "^1.3", "spatie/async": "^1.5", "spatie/crawler": "^5.0", "spatie/data-transfer-object": "^2.6", "spatie/enum": "^3.6", "spatie/laravel-enum": "^2.2", "spatie/laravel-tags": "^3.0", "spatie/laravel-validation-rules": "^2.7", "the-tinderbox/clickhouse-builder": "^4.0", "vedmant/laravel-feed-reader": "^1.5", "webmozart/assert": "^1.9" }, "require-dev": { "barryvdh/laravel-ide-helper": "^2.8", "facade/ignition": "^2.5", "fakerphp/faker": "^1.9.1", "friendsofphp/php-cs-fixer": "^2.16", "laravel/dusk": "^6.9", "mockery/mockery": "^1.4.2", "nunomaduro/collision": "^5.0", "nunomaduro/larastan": "^0.6.10", "pestphp/pest": "^0.3.13", "pestphp/pest-plugin-laravel": "^0.3.0", "phpmd/phpmd": "^2.9", "phpro/grumphp": "^1.1", "phpunit/phpunit": "^9.3.10", "psalm/plugin-laravel": "^1.4", "roave/security-advisories": "dev-master", "squizlabs/php_codesniffer": "^3.5", "vimeo/psalm": "^4.2" }, "config": { "optimize-autoloader": true, "preferred-install": "dist", "sort-packages": true }, "extra": { "laravel": { "dont-discover": [] } }, "autoload": { "psr-4": { "App\\": "app/", "Domain\\": "domain/", "Database\\Factories\\": "database/factories/", "Database\\Seeders\\": "database/seeders/" } }, "autoload-dev": { "psr-4": { "Tests\\": "tests/" } }, "minimum-stability": "dev", "prefer-stable": true, "scripts": { "post-autoload-dump": [ "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", "@php artisan package:discover --ansi" ], "post-root-package-install": [ "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" ], "post-create-project-cmd": [ "@php artisan key:generate --ansi" ], "post-update-cmd": [ "Illuminate\\Foundation\\ComposerScripts::postUpdate", "php artisan ide-helper:generate", "php artisan ide-helper:meta" ] } }

on any error i get "Package "spatie/laravel-ray" is not installed" message
but i dont want to use ray and never mentioned it in my code or configs

@jmalko
Copy link

jmalko commented Feb 10, 2021

ray is great, but I found that I had to install "vanilla" ray instead of the laravel package to get it to work. YMMV

@brmn
Copy link
Author

brmn commented Feb 10, 2021

sorry for incontinence
but it took an hour to figure out what is going on after composer update
all because of unknown package that i never mentioned in my code

@freekmurze
Copy link
Member

Can you see which one of these packages pulls in Ray?

@freekmurze
Copy link
Member

@jmalko if you want to, create a separate issue with a clear description of the problem you faced with laravel-ray

@patinthehat
Copy link
Contributor

@freekmurze My guess is that it's related to the InstalledVersions::getVersion() call in spatie/laravel-ray/src/Ray.php.
After running a quick test:

echo InstalledVersions::getVersion('spatie/laravel-ray-missing') . PHP_EOL;

image

@freekmurze
Copy link
Member

I could be, but it's strange that it would give an exception for itself not being installed.

@brmn can you post the full stack trace of the error?

@brmn
Copy link
Author

brmn commented Feb 10, 2021

`

OutOfBoundsException

Package "spatie/laravel-ray" is not installed

at vendor/composer/composer/src/Composer/InstalledVersions.php:144
140▕
141▕ return $installed['versions'][$packageName]['version'];
142▕ }
143▕
➜ 144▕ throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
145▕ }
146▕
147▕ /**
148▕ * @param string $packageName

  +9 vendor frames 

10 app/Exceptions/Handler.php:32
Illuminate\Foundation\Exceptions\Handler::report()

  +2 vendor frames 

13 [internal]:0
Illuminate\Foundation\Bootstrap\HandleExceptions::handleException()
`

@patinthehat
Copy link
Contributor

@brmn Just ruling out all possibilities here - are you using composer v2?

@brmn
Copy link
Author

brmn commented Feb 10, 2021

No, i use v1
and i know (so far) that there is no issues with v2

but question is why i have to worry about issues of a package that i dont want to use

@freekmurze
Copy link
Member

This is probably fixed by #156, I just released a new version that includes the changes in that PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants