You are viewing revision #10 of this wiki article.
This version may not be up to date with the latest version.
You may want to view the differences to the latest version or see the changes made in this revision.
Problem Statement ¶
Do you face some of these problems when using composer with your Yii install?
- Running a
composer updatedoes not fetch any new packages (even though the source is updated)
- A specific vendor package never gets updated
- Facing on and off problems when fetching packages while performing
- You ran a
composer updateearlier, but it was partially done, before you lost network connectivity, and you cannot refresh packages anymore.
Normally you need to check the package sources and if your network connectivity is stable when doing a composer update. But in most such cases above (even though rare), you may need to refresh and reinstall your composer packages.
The normal approach is to reinstall packages. Do the following:
- Backup your
vendorfolder under your app root, and delete all files in the
.gitignoreif it exists.
- Backup your
composer.lockfile on your app root, and delete it.
- Run the following command from your application root:
php composer.phar install --prefer-dist
All the packages will be refreshed by composer using the cached versions if they are the latest.
Now check and see if your problem is resolved by checking your package versions. You should also test a
php composer.phar update after this when a new package update is available, and see if it works.
You may reconfigure your
composer.lock if needed.
Note: If you feel something is gone wrong, you can revert and restore your files from your backups taken in steps 1 and 2