I'm trying to create a new Laravel project for use within Homestead, as I have successfully many times in the past, and have issued the following command:
composer create-project --prefer-dist laravel/laravel test
But unfortunately it fails with Composer could not find a composer.json file in /home/vagrant/code/test... and leaves the "test" folder empty.
The full output is here:
1/2: http://repo.packagist.org/p/provider-latest$d0bd0b2315439b65010ddf266ff3cd834b7f92edb850d5dd1f8a40c44586751f.json
2/2: http://repo.packagist.org/p/provider-2019-04$0835fd3847a1c8f8d46ee6dd6da638ec6e9846bf1dce10d9b2f10a0e953bbd04.json
Finished: success: 2, skipped: 0, failure: 0, total: 2
1/2: http://repo.packagist.org/p/provider-latest$d0bd0b2315439b65010ddf266ff3cd834b7f92edb850d5dd1f8a40c44586751f.json
2/2: http://repo.packagist.org/p/provider-2019-04$0835fd3847a1c8f8d46ee6dd6da638ec6e9846bf1dce10d9b2f10a0e953bbd04.json
Finished: success: 2, skipped: 0, failure: 0, total: 2
Installing laravel/laravel (v5.8.17)
- Installing laravel/laravel (v5.8.17): Loading from cache
Created project in test
[InvalidArgumentException]
Composer could not find a composer.json file in /home/vagrant/code/test
To initialize a project, please create a composer.json file as described in the https://getcomposer.or
g/ "Getting Started" section
create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--remove-vcs] [--no-install] [--ignore-platform-reqs] [--] [<package>] [<directory>] [<version>]
Some context: I recently updated my Homestead vagrant box to v8.0.0 and Homestead source code to v9.0.1 (and then downgraded to v8.0.1 due to strange behaviour as described here). The create-project problem reported above occurs using both Homestead v9.0.1 and v8.0.1.
UPDATE
I tried adding an empty composer.json file to the "test" folder, but that results in a "./composer.json" does not contain valid JSON error.
I even copied in the composer.json file from the laravel/laravel project, but that results in a Could not scan for classes inside "database/seeds" which does not appear to be a file nor a folder run-time exception (which is correct because the "test" folder comprises only a "vendor" folder, a composer.json file and a composer.lock file).
I've been going around in circles for a couple of days now, so any assistance would be greatly appreciated.
sudo chmod -R a+rwx /home/vagrant/code/test) seems to have resolved the composer.json error and the create-project process gets past writing the lock file. However, when it then attempts to call@php artisan package:discoverI get the 'Unable to load the "app" configuration file.' error as described in my first link. This is strange as the app.php file exists and the permissions on the "code" folder, the "test" subfolder, the "config" subfolder and the app.php file are all 777. Any thoughts?