默认
composer require endroid/qr-code
指定版本
composer require endroid/qr-code 1.9.3
# composer require endroid/qr-code 1.9.3./composer.json has been updatedloading composer repositories with package informationupdating dependencies (including require-dev)package operations: 0 installs, 1 update, 0 removals - removing endroid/qr-code (2.5.1) - installing endroid/qr-code (1.9.3): downloading (100%) the process class relies on proc_open, which is not available on your php installation. the archive may contain identical file names with different capitalization (which fails on case insensitive filesystems) unzip with unzip command failed, falling back to ziparchive classwriting lock filegenerating autoload files
以上就是composer require如何指定版本的详细内容。
