I was trying to require a package using composer require command, and I faced following error
your version of
Composer is too old Please upgrade using https://getcomposer.org/
How can I update composer itself?
I am using Linux Mint 18.3.
Use this command to update the version of composer:
composer self-update
It's now new version of composer. So anyone want to upgrade the composer, should use this command:
composer self-update --2
The best way is using this command: composer self-update --stable
//To Update Composer try
composer self-update --2
Related
I am trying to install unideveloper/laravel-password in my laravel 5.8 project using:
composer require --dev "unicodeveloper/laravel-password": "1.0.*"
But, I get the following error:
[InvalidArgumentException]
Could not find package 1.0.*.
Did you mean one of these?
lastguest/ev
1032443065/pudge
appium/php-client
authbucket/oauth2
wicochandra/captcha
how to solve this please?
Instead of updating it into composer.json file ,
Install it directly using the following command .
composer require unicodeveloper/laravel-password
Which is worked for me .
If you are looking for particular version ,
Then you can install the particular version by using the command :
composer require unicodeveloper/laravel-password:1.0.*
That syntax is for composer.json file and is not correct for CLI command
composer require vendor/package:version
for example:
composer require --dev unicodeveloper/laravel-password:1.0.*
Hope this helps
If I run composer then I get:
Warning: This development build of composer is over 60 days old. It is
recommended to update it by running
"C:\ProgramData\ComposerSetup\bin\composer.phar self-update" to get
the latest version
However, if I run the command C:\ProgramData\ComposerSetup\bin\composer.phar self-update then the following window appears, which says that the file could not be opened:
Try
php C:\ProgramData\ComposerSetup\bin\composer.phar self-update
I just figured out that I could also just execute
composer selfupdate
or
composer self-update
try Also:
composer update
it should run
I run the below commands and it worked for me, so my composer version is 1.10.20 to 2.0.9
php C:\ProgramData\ComposerSetup\bin\composer.phar self-update
composer self-update --2
i have been creating a few Laravel 5.1 and 5.2 projects.
Now i wanted to try 5.3.
when installing a new project using
composer create-project laravel/laravel my-new-project
and the project was installed, i noticed this was still a Laravel 5.2 project structure.
How to fix this?
What version of PHP are you running?
Laravel53 uses php >5.6
Composer will fallback to Laravel52 incase you do not have the correct dependancies.
If this does not solve the problem, you can always run the command as such:
composer create-project laravel/laravel=5.3.0 my-new-project --prefer-dist
You can also mention the specific version you want by running the following
composer create-project laravel/laravel=5.3 your-project-name --prefer-dist
When laravel 5 is not yet released, I install Laravel 4 using this command composer create-project laravel/laravel your-project-name --prefer-dist. But now when I use it, It installs laravel 5. I just want to use laravel 4, not yet ready for 5.
I've tried the other answers but doesn't work for me. So here's the command I use.
composer create-project laravel/laravel=4.1.27 your-project-name --prefer-dist
Source :
Installing specific laravel version with composer create-project
UPDATE
Laravel updated the installation docs of 4.* after releasing 5.
composer create-project laravel/laravel {directory} 4.2 --prefer-dist
Source: http://laravel.com/docs/4.2#install-laravel
If nothing specified composer create-project will get the latest stable version. You can change that by just specifying the version you want:
composer create-project laravel/laravel project-name ~4.2.0 --prefer-dist
This will install the latest 4.2.* version of laravel
You should download latest laravel 4.2 release from github - https://github.com/laravel/laravel/releases/tag/v4.2.11
then use composer update to download all relevant packages including latest laravel version
I use Alternate Method.
Docs says Alternate Method
Once Composer is installed, download the 4.2 version https://github.com/laravel/laravel/archive/v4.2.11.zip of the Laravel framework and extract its contents into a directory on your server. Next, in the root of your Laravel application, run the php composer.phar install (or composer install) command to install all of the framework's dependencies. This process requires Git to be installed on the server to successfully complete the installation.
If you want to update the Laravel framework, you may issue the php composer.phar update command.
U can use this
composer create-project laravel/laravel {directory} 4.2 --prefer-dist
replacing {directory} with the actual directory of your project
How do I install older version of Laravel framework using composer? The current version is 4.1 and I want to install Laravel 4.0.
either update your composer.json to what GregD mentioned or fetch it directly with
composer create-project laravel/laravel your-project-name 4.0.*
prefer this, as there can be some caveats when getting version 4.1 and wanting to downgrade (or even upgrade).
Finally it works, I just did four things:
composer create-project laravel/laravel mobilebanking 4.0
Change "dev" to "stable" in composer.json
Then run
composer self-update
After that, run this command
composer update --no-scripts
composer create–project laravel/laravel MiProyecto 5.3.* o
composer create–project laravel/laravel=5.3.* MiProyecto
Browse packagist - https://packagist.org/packages/laravel/laravel
Find version you need and add it to composer i.e.
"require": {
"laravel/laravel": "v4.0.0",
},
Install it like this:
composer create-project laravel/laravel path/to/your/directory version
For Laravel versions 5.5 it looks like this:
composer create-project laravel/laravel path/to/your/directory 5.5