使用 composer create-project 安装特定的 laravel 5 版本

2022-01-21 00:00:00 php laravel composer-php

今天我尝试使用 composer create-project laravel/laravel=5.1.8 your-project-name --prefer-dist 安装特定的 laravel 版本,因为有些插件版本有问题5.1.9 及以上.

Today I try to install specific laravel version with composer create-project laravel/laravel=5.1.8 your-project-name --prefer-dist, because some of the plugins have trouble with version 5.1.9 and above.

但是,安装失败并显示 Could not find package laravel/laravel with version 5.1.8. 如何使用 composer 安装它?

However, the installation fail and it says Could not find package laravel/laravel with version 5.1.8. How can I install it with composer?

推荐答案

你可以这样做:

composer create-project laravel/laravel myproject --prefer-dist v5.1.8

要查看可用版本,您可以访问它的 packagegist 页面(右下方):

To see available versions, you can visit its packagist page (lower right):

https://packagist.org/packages/laravel/framework

更新:

v5.1.8 包 laravel/laravel 实际上没有标签,你的问题是 laravel 的框架(核心)..

There is no actually a tag for v5.1.8 for package laravel/laravel, Your issue is the framework(core) of laravel..

您可以通过编辑 composer.json 来解决它:

What you can do to solve it is to edit your composer.json:

"require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.1.8"
    },

composer update "laravel/framework"

相关文章