Use this sample script as a basis to create your own script to install packages with
dependencies. This script contains a query that finds dependent packages and installs them
in the correct dependency order.
Sample Script
Be sure to replace the package version ID and scratch org user name with your own
specific details.