However, coming from Istanbul a direct bus (or a bus from Sofia) might be worth considering since there is no direct train connection.
Have a look at the map here: https://en.rail.cc/train-ticket ... -of-europe
By train, you have to travel by overnight train (attention, bus replacement service in operation https://en.rail.cc/istanbul-cut ... /news/n/21
to Sofia, then again by overnight train in direction of Beograd. Change in Nis for the train to Skopje.