composer update
and composer install
are similar in that they both download your dependencies, but are different in a key way.
The update command will retrieve the latest versions of all of your dependencies that meet your version constraints in your composer.json
file. Next, it has to discover the exact versions to install of your dependencies, your dependencies’ dependencies, their dependencies, and so on all the way to the bottom. If it can’t find a set of versions that satisfy all constraints, the command exits with an error explaining what it can’t resolve and why. If all dependencies can be resolved, they will be downloaded into the vendor
directory. Finally, a composer.lock
file will be generated that has the exact versions and commits that were installed.
If a lock file is present and you run composed install
, composer doesn’t have to do the dependency resolution because they’ve already been resolved. It downloads the exact version of each package from the lock file.
The message you received is telling you that your dependencies haven’t been resolved yet (by the update command), but running install will act like an update if there is no composer.lock
file.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…