No such file error when running npx patch-package

When trying to install Mautic 5.0.3 using Composer, I get the following error when running composer update from the application path /var/www/mautic:

PHP Fatal error: Uncaught Error: Failed opening required ‘/var/www/mautic/app/../autoload.php’ (include_path=’.:/usr/share/php’) in /var/www/mautic/app/console-application.php:20

Stack trace:

#0 /var/www/mautic/bin/console(15): include()

#1 {main}
thrown in /var/www/mautic/app/console-application.php on line 20

Script bin/console mautic:assets:generate handling the generate-assets event returned with error code 255

Script @generate-assets was called via post-update-cmd

The error appears to be given by the command > npx patch-package which prints

patch-package 7.0.2

My folder is /var/www/mautic and file /var/www/mautic/autoload.php doesn’t exist.