Why can't I install oauth2 client? - laravel

getting some strange errors with composer, anyone know what I can do next? I am trying to install oauth2 client on Laravel 5.1 so that I can use it to connect to an affiliate network API.
Using version ~2.2 for league/oauth2-client
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for league/oauth2-client ~2.2 -> satisfiable by league/oauth2-client[2.2.0].
- Conclusion: remove paragonie/random_compat v1.4.2
- league/oauth2-client 2.2.0 requires paragonie/random_compat ^2.0 -> satisfiable by paragonie/random_compat[v2.0.0, v2.0.1, v2.0.10, v2.0.2, v2.0.3, v2.0.4, v2.0.5, v2.0.6, v2.0.7, v2.0.8, v2.0.9].
- Can only install one of: paragonie/random_compat[v2.0.0, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.1, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.10, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.2, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.3, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.4, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.5, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.6, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.7, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.8, v1.4.2].
- Can only install one of: paragonie/random_compat[v2.0.9, v1.4.2].
- Installation request for paragonie/random_compat == 1.4.2.0 -> satisfiable by paragonie/random_compat[v1.4.2].
Installation failed, reverting ./composer.json to its original content.
my composer.json:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.1.*",
"bestmomo/scafold": "dev-master",
"illuminate/html": "5.*",
"barryvdh/laravel-dompdf": "0.6.*",
"davejamesmiller/laravel-breadcrumbs": "~3.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1"
},
"autoload": {
"classmap": [
"database",
"app/helpers"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
],
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}
}

The output of your install attempt has all the information:
Currently there is paragonie/random_compat v1.4.2 installed. Your new package requires paragonie/random_compat ^2.0 - this is an incompatible change (simply by looking at the version number, not at the code), so Composer cannot simply install the newer version.
However, some component already installed requires that older version. You can find out which one it is by running composer why paragonie/random_compat, and you can also find out why it wasn't possible to install the newer version by running composer why-not paragonie/random_compat ^2.0, which will probably output the same information.
All in all I think the suggestion on how to solve this is: Upgrade Laravel. 5.1 is rather old, and it depends on paragonie/random_compat in version ~1.4. Newer versions of Laravel (5.3 and 5.4) allow either ~1.4 or ~2.0, which would fix your issue.
I haven't looked deeper into this issue, though. It might be possible that another component also depends on this library and would also need to be updated. Laravel was my first guess.

Related

Error installing package (Installation failed, reverting ./composer.json to its original content.) (Laravel admin package - Voyager) [duplicate]

This question already has answers here:
Composer error: "PHP extension fileinfo is missing from your system"
(12 answers)
How can I resolve "Your requirements could not be resolved to an installable set of packages" error?
(17 answers)
Closed 3 years ago.
i want to install a laravel admin package -voyager version 1.3 ,so when i run this cmd $ composer require tcg/voyager i got this error always , is about the file composer.json
Using version ^1.3 for tcg/voyager
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- tcg/voyager v1.3.0 requires intervention/image ^2.4 -> satisfiable by intervention/image[2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.5.0, 2.5.1].
- tcg/voyager v1.3.1 requires intervention/image ^2.4 -> satisfiable by intervention/image[2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.5.0, 2.5.1].
- intervention/image 2.4.3 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
- intervention/image 2.4.2 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
- Installation request for tcg/voyager ^1.3 -> satisfiable by tcg/voyager[v1.3.0, v1.3.1].
To enable extensions, verify that they are enabled in your .ini files:
- C:\AppServ\php7\php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Installation failed, reverting ./composer.json to its original content.
and this is the file composer.json :
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2",
"fideloper/proxy": "^4.0",
"laravel/framework": "^6.2",
"laravel/tinker": "^2.0"
},
"require-dev": {
"facade/ignition": "^1.4",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^8.0"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
}, ..
, Do you know how to solve that? my laravel version : 6.12
Try enabling php_fileinfo.dll in you php.ini file. Just remove ; from the below line and restart your server
;extension=php_fileinfo.dll

Cannot update dependencies with composer

I am trying to install the package tymon/jwt-auth via composer on production server and I am getting errors while resolving dependencies.
I have installed it succesfully on my local vagrant environment but when on production server the following output.
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Conclusion: don't install laravel/socialite 3.0.x-dev
- Conclusion: remove guzzlehttp/guzzle 6.2.x-dev|install laravel/socialite 3.0.x-dev
- laravel/socialite v2.0.0 requires guzzlehttp/guzzle ~4.0 -> satisfiable by guzzlehttp/guzzle[4.x-dev].
- laravel/socialite v2.0.1 requires guzzlehttp/guzzle ~4.0|~5.0 -> satisfiable by guzzlehttp/guzzle[4.x-dev, 5.3.0, 5.3.1, 5.3.2, 5.3.3, 5.3.x-dev].
- laravel/socialite v2.0.2 requires guzzlehttp/guzzle ~4.0|~5.0 -> satisfiable by guzzlehttp/guzzle[4.x-dev, 5.3.0, 5.3.1, 5.3.2, 5.3.3, 5.3.x-dev].
- laravel/socialite v2.0.3 requires guzzlehttp/guzzle ~4.0|~5.0 -> satisfiable by guzzlehttp/guzzle[4.x-dev, 5.3.0, 5.3.1, 5.3.2, 5.3.3, 5.3.x-dev].
- laravel/socialite v2.0.4 requires guzzlehttp/guzzle ~4.0|~5.0 -> satisfiable by guzzlehttp/guzzle[4.x-dev, 5.3.0, 5.3.1, 5.3.2, 5.3.3, 5.3.x-dev].
- Can only install one of: guzzlehttp/guzzle[5.3.0, 6.2.x-dev].
- Can only install one of: guzzlehttp/guzzle[5.3.1, 6.2.x-dev].
- Can only install one of: guzzlehttp/guzzle[5.3.2, 6.2.x-dev].
- Can only install one of: guzzlehttp/guzzle[5.3.3, 6.2.x-dev].
- Can only install one of: guzzlehttp/guzzle[5.3.x-dev, 6.2.x-dev].
- Can only install one of: guzzlehttp/guzzle[4.x-dev, 6.2.x-dev].
- Installation request for guzzlehttp/guzzle (locked at 6.2.x-dev, required as ~5.3|~6.0) -> satisfiable by guzzlehttp/guzzle[6.2.x-dev].
- Conclusion: remove laravel/socialite 3.0.x-dev|install laravel/socialite v2.0.0|install laravel/socialite v2.0.1|install laravel/socialite v2.0.2|install laravel/socialite v2.0.3|install laravel/socialite v2.0.4
- Can only install one of: laravel/socialite[2.0.x-dev, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.10, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.11, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.12, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.13, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.14, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.15, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.16, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.17, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.18, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.19, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.20, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.21, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.22, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.5, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.6, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.7, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.8, 3.0.x-dev].
- Can only install one of: laravel/socialite[v2.0.9, 3.0.x-dev].
- Installation request for laravel/socialite (locked at 3.0.x-dev, required as ^2.0#dev) -> satisfiable by laravel/socialite[3.0.x-dev].
- Installation request for laravel/socialite ^2.0#dev -> satisfiable by laravel/socialite[2.0.x-dev, v2.0.0, v2.0.1, v2.0.10, v2.0.11, v2.0.12, v2.0.13, v2.0.14, v2.0.15, v2.0.16, v2.0.17, v2.0.18, v2.0.19, v2.0.2, v2.0.20, v2.0.21, v2.0.22, v2.0.3, v2.0.4, v2.0.5, v2.0.6, v2.0.7, v2.0.8, v2.0.9].
I've tried both on the server by running composer update and by doing composer require tymon/jwt-auth.
How can start resolving this problem?
Thanks in advance.
PS: This is my composer.json file.
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"minimum-stability": "dev",
"repositories": [
{
"type": "git",
"url": "https://github.com/cholung/laravel-model-builder.git"
},
{
"type": "git",
"url": "https://github.com/vorodevops/l5scaffold.git"
},
{
"type": "vcs",
"url": "https://github.com/alnutile/l5scaffold.git"
}
],
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.1.*",
"ramsey/uuid": "^3.2",
"intervention/image": "^2.3",
"guzzlehttp/guzzle": "~5.3|~6.0",
"laravel/socialite": "^2.0#dev",
"predis/predis": "^1.1#dev",
"pda/pheanstalk": "~3.0",
"xinax/laravel-gettext": "3.x",
"laravelcollective/html": "5.1.*",
"doctrine/dbal": "^2.5",
"moltin/laravel-cart": "^5.0",
"jenssegers/date": "^3.2",
"barryvdh/laravel-dompdf": "0.6.*",
"maatwebsite/excel": "~2.1.0",
"jenssegers/agent": "^2.3",
"yajra/laravel-datatables-oracle": "~6.0",
"wisembly/elephant.io": "^3.1",
"dimsav/laravel-translatable": "^6.0",
"sammyk/laravel-facebook-sdk": "^3.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1",
"jimbolino/laravel-model-builder" : "dev-master",
"laralib/l5scaffold": "dev-viewonly",
"barryvdh/laravel-debugbar": "^2.0"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/",
"Artvisual\\Tools\\": "packages/artvisual/tools/src",
"Artvisual\\Tools\\Providers\\": "packages/artvisual/tools/src/Providers",
"Artvisual\\Payment\\": "packages/artvisual/payment/src"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}
}
In case anyone still needs a solution to this. In this guide it says that you should
composer require the older version of guzzlehttp/guzzle, like for example composer require guzzlehttp/guzzle:^5.3.0
composer require the package you were looking out to install in the first place, like for example composer require laravel/socialite
composer remove the guzzlehttp/guzzle dependency again with composer remove guzzlehttp/guzzle
I got this error when requiring the jonasva/google-trends dependency and this solved it for me.
I've had same issue and the guzzle version was 7.0.
I have solved it by changing the version to 6.0 in composer.json and updated it.

Composer install using Homestead gives error "Your requirements could not be resolved to an installable set of packages"

I am trying to install my composer packages using the following command:
composer install --no-dev --no-scripts
The composer.json file looks like this (it's very similar to the standard Laravel composer file):
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.2.*",
"doctrine/dbal": "^2.5",
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"symfony/css-selector": "2.8.*|3.0.*",
"symfony/dom-crawler": "2.8.*|3.0.*",
"laravel/homestead": "^5.2",
"barryvdh/laravel-ide-helper": "^2.3"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist"
}
}
However when I try to install it on my production machine (which runs PHP on version v5.5.9 I get the following error:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- laravel/homestead v5.4.0 requires php ^5.6 || ^7.0 -> your PHP version (5.5.9) does not satisfy that requirement.
- laravel/homestead v5.3.2 requires php ^5.6 || ^7.0 -> your PHP version (5.5.9) does not satisfy that requirement.
- laravel/homestead v5.3.1 requires php ^5.6 || ^7.0 -> your PHP version (5.5.9) does not satisfy that requirement.
- laravel/homestead v5.3.0 requires php ^5.6 || ^7.0 -> your PHP version (5.5.9) does not satisfy that requirement.
- laravel/homestead v5.2.4 requires php ^5.6 || ^7.0 -> your PHP version (5.5.9) does not satisfy that requirement.
- laravel/homestead v5.2.1 requires php ^5.6 || ^7.0 -> your PHP version (5.5.9) does not satisfy that requirement.
- laravel/homestead v5.2.0 requires php ^5.6 || ^7.0 -> your PHP version (5.5.9) does not satisfy that requirement.
- laravel/homestead 5.2.3 requires php ^5.6 || ^7.0 -> your PHP version (5.5.9) does not satisfy that requirement.
- laravel/homestead 5.2.2 requires php ^5.6 || ^7.0 -> your PHP version (5.5.9) does not satisfy that requirement.
- Installation request for laravel/homestead ^5.2 -> satisfiable by laravel/homestead[5.2.2, 5.2.3, v5.2.0, v5.2.1, v5.2.4, v5.3.0, v5.3.1, v5.3.2, v5.4.0].
So my questions is as follows:
Why is homestead even being installed when I said --no-dev and homestead is a dev package?
If I did want to install Homestead on my production machine, how can I solve the above problem?
--no-dev should not install the dev dependencies. Check your production build scripts (or whatever you are using to run this on production), that --no-dev is indeed added.
For the second part of your question, you can avoid the error by changing laravel/homestead package version to ~4.0 or 4.0.5 to be more precise to make it compatible with your php version.

Your requirements could not be resolved: failed to open stream: Permission denied

I Need to install DomPDf in my Project. So, i add "barryvdh/laravel-dompdf": "v0.7.0", to composer require block. when i update composer display following Errors. Whats my Mistakes.... Please Specify to me..
Terminal Errors
Your requirements could not be resolved to an installable set of packages.
Problem 1
- dompdf/dompdf v0.7.0-beta3 requires phenx/php-font-lib 0.4.* -> no matching package found.
- dompdf/dompdf v0.7.0-beta2 requires phenx/php-font-lib 0.4.* -> no matching package found.
- dompdf/dompdf v0.7.0-beta requires phenx/php-font-lib 0.3.* -> no matching package found.
- dompdf/dompdf v0.7.0 requires phenx/php-font-lib 0.4.* -> no matching package found.
- dompdf/dompdf 0.7.x-dev requires phenx/php-font-lib 0.5.* -> no matching package found.
- barryvdh/laravel-dompdf v0.7.0 requires dompdf/dompdf ^0.7 -> satisfiable by dompdf/dompdf[0.7.x-dev, v0.7.0, v0.7.0-beta, v0.7.0-beta2, v0.7.0-beta3].
- Installation request for barryvdh/laravel-dompdf v0.7.0 -> satisfiable by barryvdh/laravel-dompdf[v0.7.0].
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
My Composer Code
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"minimum-stability" : "dev",
"prefer-stable": true,
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"barryvdh/laravel-debugbar": "^2.3",
"barryvdh/laravel-dompdf": "v0.7.0",
"laravel/framework": "5.4.*",
"laravel/tinker": "~1.0",
"uxweb/sweet-alert": "^1.4"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~5.0"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
}
I've also tried:
composer require barryvdh/laravel-dompdf
but it display following error:
Error : Using version ^0.8.0 for barryvdh/laravel-dompdf ./composer.json has been updated Loading composer repositories with package information
Updating dependencies (including require-dev)
file_put_contents(/home/w3cert/.composer/cache/repo/https---‌​packagist.org/p-prov‌​ider-2017-01.json): failed to open stream: Permission denied
packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date
Your requirements could not be resolved to an installable set of packages.
Since you've got the Permission denied error when running composer require barryvdh/laravel-dompdf, this is the command which should fix them:
chown -R $USER ~/.composer
or:
sudo chown -R $USER ~/.composer
Then clear the Composer caches:
composer clear
After than try to avoid running composer command with sudo to not break the file permissions.
If there is still any problem, in order to troubleshoot, run the following shell command:
composer diagnose
Why don't you try to install it from the command line
composer require barryvdh/laravel-dompdf
please delete this line from composer.json before installation.
"barryvdh/laravel-dompdf": "v0.7.0"
Anyway the current version of laravel-dompdf:(v0.8.0)
The installation should work with the current version of dompdf
"barryvdh/laravel-dompdf": "^0.8.0"

Install specific version using laravel installer

As of now, if I use this command
laravel new blog
It will create a laravel project with the latest version like 5.2, but what if I want to install a specific version, ie. version 5.1?
UPDATE:: I am looking for laravel installer command, is there is any option/parameter for specific version installation?
Using composer you can specify the version you want easily by running
composer create-project laravel/laravel="5.1.*" myProject
Using the 5.1.* will ensure that you get all the latest patches in the 5.1 branch.
use
laravel new blog --version
Example laravel new blog --5.1
You can also use the composer method
composer create-project laravel/laravel app "5.1.*"
here, app is the name of your project
please see the documentation for laravel 5.1 here
UPDATE:
The above commands are no longer supports so please use
composer create-project laravel/laravel="5.1.*" appName
You can use composer method
like
composer create-project laravel/laravel blog "5.1"
Or here is the composer file
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.1.*"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
],
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}
}
use laravel new blog --5.1
make sure you must have laravel installer 1.3.4 version.
The direct way as mentioned in the documentation:
composer create-project --prefer-dist laravel/laravel blog "6.*"
https://laravel.com/docs/6.x/installation
Via composer installing specific version 8.*
composer create-project laravel/laravel:^8.* project_name
using composer installing specific version 7.*
composer create-project --prefer-dist laravel/laravel:^7.0 project_name
To install specific version 6.* and below use the following command:
composer create-project --prefer-dist laravel/laravel project_name "6.*"
Year 2022
Since Laravel 5.2 (2017) it is not possible to install a specific Laravel Version via Laravel Installer. Use instead composer create-project. For example:
composer create-project --prefer-dist laravel/laravel blog "7.*"
// That will install Version the latest version of Laravel 7.
// would install:
"laravel/framework": "^7.29",
composer create-project --prefer-dist laravel/laravel blog "5.*"
// would install:
"laravel/framework": "5.8.*",
composer create-project --prefer-dist laravel/laravel blog
Would install the latest Laravel version on your local machine.
For newer version of laravel:
composer create-project --prefer-dist laravel/laravel=5.5.* project_name
From Laravel 6, Now It's working with the following command:
composer create-project --prefer-dist laravel/laravel:^7.0 blog
you can find all version install code here by changing the version of laravel doc
composer create-project --prefer-dist laravel/laravel yourProjectName "5.1.*"
above code for creating laravel 5.1 version project.
see more in laravel doc. happy coding!!
you can use this command
composer create-project laravel/laravel:^8.*.* exam-app
composer create-project --prefer-dist laravel/laravel project_name "version_num"
Example ::
suppose, i would like to create a new project called- blog
where i would like to use laravel 6.0 LTS version,,
following that command
composer create-project --prefer-dist laravel/laravel blog "6.*"
Another possibility is to
laravel new my-project --branch 9.x

Resources