TheWebs
TheWebs

Reputation: 12923

Composer not installing or updating package

I create a package and pushed it to github, My composer.json for that package looks like such:

{
        "name": "adam.balan/AisisAjax",
        "description": "This is a component for AisisCore, that is - it should be installed to the Components section of the web based framework for wordpress.",
        "license": "GPL v3",
        "authors": [
                {
                        "name": "Adam Kyle Balan",
                        "email": "[email protected]"
                }
        ],
        "minimum-stability": "dev",
        "require": {
        }
}

It all works fine for me - for using composer install the first time, how ever if I make a change and push it to the repository and run composer install (or even delete the vendor folder and run the command again to do a fresh install) I get a version that reflects the first commit I ever did to this repo. In other words my chanegs do not show up in whats being downloaded.

I have read about caching issues with composer and went to C:\Users\<user>\AppData\Local\Composer and deleted all the files in there - same issue.

What gives?

Upvotes: 0

Views: 13120

Answers (1)

Sven
Sven

Reputation: 70853

If you do not use a defined version that is tagged in the repository, but a branch you are developing on, Composer detects which commit was downloaded and will always download that exact commit if you only "install".

If you want Composer to update any dependency, you have to call composer update.

Note that Composer creates a lock file that contains this info, because the usual case is that someone wants to restore the exact combination of dependencies that were used when the software was composed. If you develop actively on the software, simply update your dependencies more often. :)

Upvotes: 6

Related Questions