我正在开始一个新项目,我想用一个新版本的laravel启动它.我不想升级和旧版本.
如何创建Laravel 5.2项目?
我的问题在哪里,我做了什么:
我安装了laravel 5.1
composer create-project --prefer-dist laravel/laravel projectname
也laravel new projectname
有同样的问题.
这是安装新项目后的作曲家文件
{ "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" }, ...
我也尝试过
composer create-project laravel/laravel=5.2.0 projectname
但我得到了这个错误
could not find package laravel/laravel with version 5.2.0.
我试过composer self-update
同样的问题我读了laravel 5.2文档.它正式出局
如果你看一下/sf/ask/17360801/,当Laravel 5处于开发版本时会问到同样的问题.
现在,如果要创建5.2项目,则需要dev-develop
在composer create project中使用该版本:
composer create-project laravel/laravel your-project-name dev-develop
但是如果你想安装5.1版本,你可以使用
composer create-project laravel/laravel your-project-name 5.1.*
或简单:
composer create-project laravel/laravel your-project-name
类似于旧版本,例如:
composer create-project laravel/laravel your-project-name 5.0.*
要么
composer create-project laravel/laravel your-project-name 4.2.*
当Laravel 5.2将稳定发布时,您将能够使用它进行安装
composer create-project laravel/laravel your-project-name 5.2.*
或者简单
composer create-project laravel/laravel your-project-name
和使用
composer create-project laravel/laravel your-project-name dev-develop
您可能会安装Laravel 5.3的开发版本
该Laravel 5.2文档在这里有正确的解决方案:
composer create-project --prefer-dist laravel/laravel blog "5.2.*"