Skip to content

Instantly share code, notes, and snippets.

@timkelty
Created September 15, 2025 12:51
Show Gist options
  • Save timkelty/b9842aba938a33b623abf5bfbb656c5b to your computer and use it in GitHub Desktop.
Save timkelty/b9842aba938a33b623abf5bfbb656c5b to your computer and use it in GitHub Desktop.
Composer Link / Alias
{
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"craftcms/ckeditor": "^3.14",
"craftcms/cloud": "*",
"craftcms/cms": "^4.16",
"vlucas/phpdotenv": "^5.4.0"
},
"require-dev": {
"craftcms/generator": "^1.3.0",
"sandersander/composer-link": "dev-master",
"yiisoft/yii2-shell": "^2.0.3"
},
"config": {
"allow-plugins": {
"craftcms/plugin-installer": true,
"yiisoft/yii2-composer": true,
"sandersander/composer-link": true
},
"sort-packages": true,
"optimize-autoloader": true
},
"repositories": [
{
"type": "composer",
"url": "https://composer.craftcms.com",
"canonical": false
}
]
}
@timkelty
Copy link
Author

timkelty commented Sep 15, 2025

I have these repos checked out:

  • git clone --single-branch --branch 1.x https://github.com/craftcms/cloud-extension-yii2.git packages/craftcms/cloud
  • git clone --single-branch --branch 4.x https://github.com/craftcms/cms.git packages/craftcms/cms
❯ composer link "packages/*/*"
Linking packages, Lock file will be generated in memory but not written to disk.
Loading composer repositories with package information
Updating dependencies
Unable to find a compatible set of packages based on your non-dev requirements alone.
Your requirements can be resolved successfully when require-dev packages are present.
You may need to move packages from require-dev or some of their dependencies to require.

  Problem 1
    - Root composer.json requires craftcms/ckeditor ^3.14 -> satisfiable by craftcms/ckeditor[3.14.1].
    - craftcms/ckeditor 3.14.1 requires craftcms/cms ^4.5.0-beta.2 -> found craftcms/cms[dev-linked] but it does not match the constraint.
  Problem 2
    - Root composer.json requires craftcms/cloud == dev-linked -> satisfiable by craftcms/cloud[dev-linked].
    - craftcms/cloud dev-linked requires craftcms/cms ^4.15 -> found craftcms/cms[dev-linked] but it does not match the constraint.

Linking packages finished!

Works find on composer-link:0.4.1

@SanderSander
Copy link

SanderSander commented Sep 16, 2025

@timkelty Thanks!! This is very useful, maybe the error comes from the following, I will take a look soon :)

  "repositories": [
    {
      "type": "composer",
      "url": "https://composer.craftcms.com",
      "canonical": false
    }
  ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment