To be fair, in the case of the Lightning, the early marks (F1/F1A & F2/F2A) had cannon, but some twit decided to remove them from the F.3/F6, only to have to find a way of putting them back in the F.6 at the expense of badly needed fuel
In the case of the Harrier, and thinking out loud, so excuse this old git of an engineer being not up to speed with current electro-whiz-bang technology, but what about jury rigging a pair of those self contained ex-F4 Gatling centreline pods....one each under a wing pylon....just thinking out loud about the old days of resourcefull adapdation of kit to fit a task.......but I suppose we wouldn't have any of them left in store anywhere now either