In a way there was a real world naval, carrier based version of the F-104. This was the CL-1400N ( see pic below). To get from here to the F-104 you need to follow the path below:
The CL-1400N was derived from the CL-1400 concept and had the cockpit moved to the front for better view during landing.
The CL-1400 was itself basically a derivative of the CL-1200 proposal with longer fuselage, more powerful engine and increased range.
The Lockheed CL-1200 Lancer was a company-funded proposal for a derivative of the F-104 Starfighter intended for the export market. The CL-1200 design retained the F-104 fuselage, though with a shoulder-mounted wing of larger area moved further aft and a changed tailsection to a more convential shape. It was proposed in August 1970. This project was not successful since more low cost fighters had been introduced to the market like the Northrop F-5.