我正在尝试创建一个新的Laravel项目,以便在Homestead中使用,因为我过去已经成功多次了,并发布了以下命令:
composer create-project --prefer-dist laravel/laravel test
,但不幸的是,Composer could not find a composer.json file in /home/vagrant/code/test...
失败并将"测试"文件夹空白。
全部输出在这里:
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>]
一些上下文:我最近将Homestead Vagrant Box更新为V8.0.0,将Homestead源代码和homestead源代码更新为v9.0.1(然后由于此处所述的奇怪行为,将其降级为v8.0.1(。上面报告的创建项目问题是使用Homestead v9.0.1和V8.0.1。
发生的。update
我尝试在"测试"文件夹中添加一个空的composer.json文件,但这会导致"./composer.json" does not contain valid JSON
错误。
i什至从laravel/laravel项目中复制在composer.json文件中,但这会导致Could not scan for classes inside "database/seeds" which does not appear to be a file nor a folder
运行时异常(这是正确的(因为"测试"文件夹仅包含一个"供应商"文件夹,一个作曲家。json文件和composer.lock文件(。
我已经在圈子里走了几天,因此任何帮助都将不胜感激。
,所以事实证明这是一个许可问题,太好了。
我做的事情,我不使用宅基地,但是docker(虽然相似(是,我不从主机运行作曲家命令或laravel命令,而是从虚拟机内部运行。
这样,您不必 sudo chmod -R a+rwx /home/vagrant/code/test
不好(因为它为用户,群体和其他人提供了读/写/执行权限(
只需进入您的宅基机器,运行composer create-project --prefer-dist laravel/laravel test
和以后的php artisan package:discover
,就应该避免所有这些麻烦。