It depends on how you feel about bar end shifters.

I'm a fan of 9 speed and you can still get decent cassettes and chains. Nice 10 speed derailleurs are still out there and work fine with 9 speed. The problem is shifters. It's been years since there have been new mid range or better Shimano 9 speed brifters. Bar ends and their derivatives are all that's still available. Same is happening with 10 speed, no new 105 or better and NOS is drying up. So skip 10 speed if you have to change. You always want a cassette and chain or two in reserve, just for convenience, but you don't want to be left with a bunch when you have to move on.