composer: Fail to install laravel with the latest version composer
I failed to install laravel with the latest version composer, but success to do with 1.0.0-alpha11 1.0.0-beta1.
$ php composer.phar create-project --prefer-dist laravel/laravel blog
Installing laravel/laravel (v5.2.15)
- Installing laravel/laravel (v5.2.15)
Loading from cache
Created project in blog
> php -r "copy('.env.example', '.env');"
> php artisan clear-compiled
PHP Warning: require(/home/vagrant/laraveltest/blog/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /home/vagrant/laraveltest/blog/bootstrap/autoload.php on line 17
PHP Fatal error: require(): Failed opening required '/home/vagrant/laraveltest/blog/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/vagrant/laraveltest/blog/bootstrap/autoload.php on line 17
Script php artisan clear-compiled handling the pre-update-cmd event returned with an error
[RuntimeException]
Error Output: PHP Warning: require(/home/vagrant/laraveltest/blog/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /home/vagrant/laraveltest/bl
og/bootstrap/autoload.php on line 17
PHP Fatal error: require(): Failed opening required '/home/vagrant/laraveltest/blog/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/vagr
ant/laraveltest/blog/bootstrap/autoload.php on line 17
create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--keep-vcs] [--no-install] [--ignore-platform-reqs] [--] [<package>] [<directory>] [<version>]
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 8
- Comments: 16 (11 by maintainers)
Though I will note this is going to break a shit load of sites and cause me a support nightmare đŹ đź
This is a configuration issue in laravel IMO, not a composer issue, please report it there.
An sort-of workaround would be to allow commands to soft-fail, without stopping the entire process.
"pre-install-cmd": ["@php artisan clear-compiled"]
pre/post-install-cmd
scripts. Now we normalized it to actually run an update and firepre/post-update-cmd
, because thatâs what it is doing. If you have a lock file though it will run install as before.pre-***-cmd
you can rely on them, but you can not assume that the autoload.php and so on will be present, as on the first install they wonât be.@stof keep the previous way it worked.
Also why is it running on
composer create-project
thatâs clearly not a update but the creation of a new project. It may be doing a update under the hood but exposing that to the user by triggering the hooks doesnât seem right.Especially since the manual only says:
It doesnât say anywhere it occurs on
composer install
orcomposer create-project
.As I understand it these hooks are linked to the commands and not to the thing these commands do under the hood thatâs why the previous behaviour made more sense.
I would give it a different name if I wanted to expose hooks to the underlying logic since everyone is already relying on the current hooks to work as the always did.
From a user point of view, running
composer install
sounds like it involves installing and nothing else, whether there is a lock file or not.Indeed, when there is no lock file an âupdateâ has be done beforehand, but for the user it just sounds like âfresh installâ.