Yooouuri Yooouuri - 1 month ago 12
PHP Question

The requested package ... could not be found in any version

When I want to require my project, the following errors shows up:

The requested package mvc-php/framework could not be found in any version, there may be a typo in the package name.

The "mvc-php/framework" is a git folder.

{
"name": "mvc-php/app",
"repositories": [
{
"type": "path",
"url": "/Users/youri/Documents/Github/framework"
}
],
"require": {
"php": ">=7.0",
"mvc-php/framework": "master"
},
"autoload": {
"psr-4": {
"App\\": "app/"
}
}
}


Project i want to require:

{
"name": "mvc-php/framework",
"description": "PHP MVC framework",
"autoload": {
"psr-4": {
"Mvc\\" : "src/"
}
},
"require": {
"php": ">=7.0"
}
}

Answer

instead of just the branch name, you must require master@dev

{
    "name": "mvc-php/app",
    "repositories": [
        {
            "type": "path",
            "url": "/Users/youri/Documents/Github/framework"
        }
    ],
    "require": {
        "php": ">=7.0",
        "mvc-php/framework": "master@dev"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/"
        }
    }
}