Nitpick: Knights are not weak defenders. They have the defense value of Pikemen, and retreat ability on top on that.
Still, they're very expensive (compared to other early medieval units), so one should still take every chance to attack them in the open. But if your outnumbered, you shouldn't attack them when they're hiding on Hills or Mountains (unless they're redlined), if it can be avoided.
You could try fielding more Catapults. They're good at hurting Medievals footslogging towards your cities, and against Knights they may just give your Pikemen the necessary edge by knocking off an extra hitpoint when the Knight charges.
But the real problem seems to be that you're not emerging from the ancient times with enough productive capacity. You might want to check out the War Academy for articles of building up your infrastructure. (Do you use the Despotic Whip (tm) alot? If yes, you may want to try to decrease it, since it hurts your long-term economic and industrial growth.)
And a final point: Don't expect the Musketmen to save you. Sure, they defend 33% better than Pikemen, but they cost a frikken 100% more. During wartime, having two Pikemen is almost always preferable to having one Musketman.