For some years I had problems when updating or installing a site with composer from my vagrant box.
For drupal 8, take a look into composer.json and checkout for 'extra' section. Add the file_mapping:
function getNumPagesInPDF($PDFPath = NULL)
$stream = fopen($PDFPath, "r");
$PDFContent = fread ($stream, filesize($PDFPath));