Issues after upgrading from 7.14.4 to 8.6.1 - missing formatting in HTML

To try and solve this issue, I ran:

composer install --no-dev

in the main directory and the public/legacy/

I can now log into the system but unfortunately I’ve still got the same issue of the pages not displaying properly.