Composer not downloading src directory for packages

佐手、 提交于 2019-12-12 12:07:37

问题


I'm using Laravel and Composer to build a web app.

On my local machine I have its requirements setup within the composer.json file and everything works as it should.

I'm using Github to push to the production server, however, I then run composer install and add the providers and aliases for one of my packages, I then get an error saying that the service provider hasn't been found.

I then proceeded to check the vendor folder, which had the directory in it for the package, but within this directory it's missing all the files/folders, such as the composer.json, src directory, etc.

Any ideas why these are not being downloaded? The src directory for other packages are fine, like symfony, laravel, but not the packages I've set as required.

The package I'm using is artdarek/oauth-4-laravel, on my local machine it downloaded fine including the src directory, etc.

Oh and I'm using Forge by Laravel to deploy to a cloud server at Digital Ocean.

{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
    "laravel/framework": "4.2.*",
    "artdarek/oauth-4-laravel": "dev-master"
},
"autoload": {
    "classmap": [
        "app/commands",
        "app/controllers",
        "app/models",
        "app/database/migrations",
        "app/database/seeds",
        "app/tests/TestCase.php"
    ],
    "psr-4": {
        "Karl\\": "app/Karl"
    }
},
"scripts": {
    "post-install-cmd": [
        "php artisan clear-compiled",
        "php artisan optimize"
    ],
    "post-update-cmd": [
        "php artisan clear-compiled",
        "php artisan optimize"
    ],
    "post-create-project-cmd": [
        "php artisan key:generate"
    ]
},
"config": {
    "preferred-install": "dist"
},
"minimum-stability": "stable"

}


回答1:


This might work. Try updating composer (to keep current) and updating your app:

composer self-update
composer install
composer update

I had a slightly similar issue that install didn't resolve but update did



来源:https://stackoverflow.com/questions/25462185/composer-not-downloading-src-directory-for-packages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!