One does not attack a carrier. One may, if one is crazy enough, attack a carrier group but is almost certain suicide and will remain so for a very long time.
According to the article, anti-ship missiles have a longer range than the distance carrier attack planes can travel to a target and knock it out and get back to the ship. Also, with mobile launchers, they won’t stay there in place, anyway. Plus, firing salvos of missiles, the anti-missile shipboard defenses can be overwhelmed. Like the article also says, carriers are on the wrong side of physics and math.
Really? Tell that to the Sweds
Sweden Has A Sub That's So Deadly The US Navy Hired It To Play Bad Guy