I have a composer file for a laravel installation with the following composer.json file:
{ "name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"], "license": "MIT", "require": { "laravel/framework": "4.1.*" }, "autoload": { "classmap": [ "app/commands", "app/controllers", "app/models", "app/database/migrations", "app/database/seeds", "app/tests/TestCase.php" ] }, "scripts": { "post-install-cmd": [ "php artisan clear-compiled", "php artisan optimize" ], "post-update-cmd": [ "php artisan clear-compiled", "php artisan optimize" ], "post-create-project-cmd": [ "php artisan key:generate" ] }, "config": { "preferred-install": "dist" }, "minimum-stability": "stable" }
I'm trying to add in the bundle for sentry. On sentry's website it says I can install it by adding the following to my composer.json file:
{ "require": { "cartalyst/sentry": "2.0.*" }, "minimum-stability": "dev" }
I tried adding the new json object at the end of the current laravel one like so:
... }, { "require": { "cartalyst/sentry": "2.0.*" }, "minimum-stability": "dev" }
When I run the composer update
command to load the new package I get an error saying that the new object addition is not valid json.
If I add the cartalyst/sentry
to the existing require
object it cannot find the sentry package because the existing requires have a minimum-stability value of stable
.
Is there a way of specifying the sentry package in a separate require object that has the minimum-stability setting of dev
?
minimum-stability (root-only)# (Note that you can also specify stability requirements on a per-package basis using stability flags in the version constraints that you specify in a require block (see package links for more details). Available options (in order of stability) are dev , alpha , beta , RC , and stable .
require: These are must packages for the code to run. It defines the actual dependency as well as package version. require_dev: It defines the packages necessary for developing the project and not needed in production environment. Note: The require and require_dev are important parameters available in composer.
Try clearing Composer's cache by running composer clear-cache . Ensure you're installing vendors straight from your composer. json via rm -rf vendor && composer update -v when troubleshooting, excluding any possible interferences with existing vendor installations or composer. lock entries.
The answer is just add @dev
{ "require": { "cartalyst/sentry": "2.0.*@dev" }, }
You can read more about minimum stability settings here.
An alternative is to set your minimum-stability to dev, but tell composer you want to use stable whenever possible:
"minimum-stability": "dev", "prefer-stable" : true
This basically means it will always use stable UNLESS there is no way to install a stable dependency, and therefore use dev.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With