Same problem on a late 2013 MacBook Pro ‘15 Retina. Battery is bad, needs replacing. I just wiped the hard drive, did a fresh reinstall of Mavericks, immediately updated to Mojave. Then I used Migration Assistant to restore my files and user account from a recent Time Capsule backup.
Now same problem, System Preferences -> Trackpad doesn’t see the built-in trackpad and is trying and failing to find an external one. Built-in trackpad works fine, but OS X can’t see it.
Since this is a fresh install the solution above to reinstall doesn’t seem relevant.