0

I'm trying to create custom composer packages in order use/update some custom wordpress plugins across all my projects.

I decided on using satis, following this article: https://getcomposer.org/doc/articles/handling-private-packages-with-satis.md

I've installed satis, and successfully generated the webview and deployed it. It shows the two composer packages (git repositories) that were linked with satis.

Problem

When I create a new project and include my custom composer package in my package.json, running composer update returns an error.

Error

composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package namespace/test 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.
 - It's a private package and you forgot to add a custom repository to find it

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

My package composer.json file:

{
  "name": "name",
  "type": "project",
  "license": "MIT",
  "description": "desc",
  "authors": [],
  "keywords": ["bedrock", "wp"],
  "config": {
    "preferred-install": "dist"
  },
  "repositories": [
    {
      "type": "composer",
      "url": "https://wpackagist.org"
    },
    {
        "type": "composer",
        "url": "https://packages.namespace.tld"
    }
  ],
  "require": {
    "php": ">=5.6",
    "composer/installers": "^1.4",
    "vlucas/phpdotenv": "^2.0.1",
    "johnpbloch/wordpress": "^5.0.2",
    "oscarotero/env": "^1.1.0",
    "roots/wp-password-bcrypt": "1.0.0",
    "roots/wp-config": "1.0.0",

    "wpackagist-plugin/contact-form-7": "*",
    "namespace/test": "*"
  },
  "require-dev": {
    "squizlabs/php_codesniffer": "^3.0.2",
    "roave/security-advisories": "dev-master"
  },
  "extra": {
    "installer-paths": {
      "www/app/mu-plugins/{$name}/": ["type:wordpress-muplugin"],
      "www/app/plugins/{$name}/": ["type:wordpress-plugin"],
      "www/app/themes/{$name}/": ["type:wordpress-theme"]
    },
    "wordpress-install-dir": "www/wp"
  },
  "scripts": {
    "post-root-package-install": [
      "php -r \"copy('.env.example', '.env');\""
    ],
    "test": [
      "phpcs"
    ]
  }
}
jnaklaas
  • 1,619
  • 13
  • 16
  • Possible duplicate of [How to solve the 'package not available in stable-enough version' error of composer?](https://stackoverflow.com/questions/22536978/how-to-solve-the-package-not-available-in-stable-enough-version-error-of-compo) – Nico Haase Feb 08 '19 at 13:37
  • 1
    As a hint: there is only a `dev-master` branch of your package available, no tagged release – Nico Haase Feb 08 '19 at 13:38
  • @NicoHaase I'm not quite used to tagging and releasing. I created a git tag "1.0.0", pushed this to the git origin, created a release branch on bitbucket also named "1.0.0", not entirely sure what I'm doing. Still doesn't work. – jnaklaas Feb 08 '19 at 13:58
  • 1
    Your satis still shows the untagged version - have you updated the list there, too? – Nico Haase Feb 08 '19 at 14:00
  • @NicoHaase Thank you! All references for salis are assuming this is obvious. To me it wasn't, so thanks for helping out!!! – jnaklaas Feb 08 '19 at 14:18
  • You're welcome - Satis is a bit tricky on the first steps, but you'll see the benefits – Nico Haase Feb 08 '19 at 14:19
  • For future reference, creating a git tag and pushing it to the git origin was sufficient to create versions. – jnaklaas Feb 08 '19 at 14:24
  • Oh, if you want to, write an answer about your findings – Nico Haase Feb 08 '19 at 14:24

0 Answers0