Skip to content
Advertisement

“Could not scan for classes inside” error when trying to load a Github repository through composer

I am trying to autoload a Github repository with the following config in the composer.json file

"repositories": [
        {
            "type":"package",
            "package": {
                "name": "webdevstudios/taxonomy-single-term",
                "version":"0.2.2",
                "dist": {
                    "url": "https://github.com/WebDevStudios/Taxonomy_Single_Term/archive/master.zip",
                    "type": "zip"
                },
                "source": {
                    "url": "https://github.com/WebDevStudios/Taxonomy_Single_Term.git",
                    "type": "git",
                    "reference":"master"
                },
                "autoload": {
                    "files": ["class.taxonomy-single-term.php", "walker.class.taxonomy-single-term.php"]
                }
            }
        }
],

When run composer update/dumpautoload, I get the following error:

[RuntimeException]                                                                                   
  Could not scan for classes inside "project1/vendor/  
  webdevstudios/taxonomy-single-term/taxonomy-single-term/" which does not appear to be a file nor a   
  folder

Am I missing any specific configuration for the autoload, because “classmap”, “psr-0” or any other configuration doesnt work.

Thanks for the help.

PS: the source files exist i “project1/vendor/
webdevstudios/taxonomy-single-term/”. Not sure why I am getting the extra “taxonomy-single-term”.

Advertisement

Answer

I was able to resolve the issue. Deleted the vendor folder and composer.lock and ran composer install again. This time everything loaded properly.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement