2017-07-28 3 views
0

Githubでライブラリをフォークし、フォークされたライブラリをpackagistに追加せずにプロジェクトにフォークをロードします。私はリポジトリを追加した後、次のエラーを取得し、私のcomposer.jsonに必要になります。ここではGithubフォークを使ってコンポーザーパッケージをロードする

Your requirements could not be resolved to an installable set of packages. 

    Problem 1 
    - The requested package cnizzardini/ssl-certificate could not be found in any version, there may be a typo in the package name. 

Potential causes: 
- A typo in the package name 
- The package is not available in a stable-enough version according to your minimum-stability setting 
    see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details. 

は私の完全なcomposer.jsonは

{ 
    "name": "cakephp/app", 
    "description": "CakePHP skeleton app", 
    "homepage": "http://cakephp.org", 
    "type": "project", 
    "license": "MIT", 
    "require": { 
     "php": ">=5.5.9", 
     "cakephp/cakephp": "~3.4", 
     "mobiledetect/mobiledetectlib": "2.*", 
     "cakephp/migrations": "~1.0", 
     "cakephp/plugin-installer": "*", 
     "guzzlehttp/guzzle": "^6.2", 
     "donatj/phpuseragentparser": "^0.7.0", 
     "cnizzardini/ssl-certificate": "dev-master" 
    }, 
    "require-dev": { 
     "psy/psysh": "@stable", 
     "cakephp/debug_kit": "~3.2", 
     "cakephp/bake": "~1.1", 
     "phpunit/phpunit": "^5.5" 
    }, 
    "suggest": { 
     "phpunit/phpunit": "Allows automated tests to be run without system-wide install.", 
     "cakephp/cakephp-codesniffer": "Allows to check the code against the coding standards used in CakePHP." 
    }, 
    "autoload": { 
     "psr-4": { 
      "App\\": "src", 
      "Api\\": "./plugins/Api/src", 
      "Channel\\": "./plugins/Channel/src", 
      "System\\": "./plugins/System/src", 
      "Admin\\": "./plugins/Admin/src" 
     } 
    }, 
    "autoload-dev": { 
     "psr-4": { 
      "App\\Test\\": "tests", 
      "Cake\\Test\\": "./vendor/cakephp/cakephp/tests", 
      "Api\\Test\\": "./plugins/Api/tests", 
      "Channel\\Test\\": "./plugins/Channel/tests", 
      "System\\Test\\": "./plugins/System/tests", 
      "Admin\\Test\\": "./plugins/Admin/tests" 
     } 
    }, 
    "scripts": { 
     "post-install-cmd": "App\\Console\\Installer::postInstall", 
     "post-create-project-cmd": "App\\Console\\Installer::postInstall", 
     "post-autoload-dump": "Cake\\Composer\\Installer\\PluginInstaller::postAutoloadDump" 
    }, 
    "repositories": [ 
     { 
      "type": "vcs", 
      "url": "https://github.com/cnizzardini/ssl-certificate.git" 
     } 
    ], 
    "minimum-stability": "stable", 
    "prefer-stable": true 
} 

である私はと.gitなしhttps://github.com/cnizzardini/ssl-certificateを追加しようとしています。私はまた、最小安定性をdevに設定し、falseに安定させることを試みました。

何もそれはあなたが必要とする必要があるパッケージの名前ですので、あなたのフォーク上のcomposer.jsonファイルがまだ、パッケージ"spatie/ssl-certificate"を呼び出し:-(

+0

[コンポーザでフォークを要求する方法](https://stackoverflow.com/questions/13498519/how-to-require-a-fork-with-composer) – rickdenhaan

+0

閉じる可能性がありますが、フィックスI必要なのは若干異なります。フォークを参照する必要がありました。 – systematical

答えて

2

働かない

これは動作するはずです:。

{ 
    ... 
    "require": { 
     ... 
     "spatie/ssl-certificate": "dev-master" 
    }, 
    ... 
    "repositories": [ 
     { 
      "type": "vcs", 
      "url": "https://github.com/cnizzardini/ssl-certificate.git" 
     } 
    ], 
    ... 
} 

composer.jsonファイルのnameプロパティを変更して、自分のフォーク上でパッケージの名前を変更することができます。

+0

これで、spatie/ssl-certificateが取得されます。私は私のフォークが必要です:cnizzardini/ssl-certificate – systematical

+1

これがうまくいかない場合は、あなたのフォークの[composer.jsonファイル](https://github.com/cnizzardini/ssl-証明書/ blob/master/composer.json) – rickdenhaan

+0

これはうまくいきました。あなたの答えを更新すると、それを正しいものとして受け入れることになります。 – systematical

関連する問題