I might be completely clueless, but Ukraine doesn't have anywhere near the same amount of strategic or economic importance that Taiwan does. As I understand it, what should have been done was for NATO to promise to not add Ukraine and keep it as a neutral zone between Russia and the US. Adding Ukraine to NATO was effectively putting US troops on Russia's doorstep and I can see why that makes Russia nervous. It seems pretty clear that Ukraine wasn't going to get NATO membership anyways.
I don't know if the promise would have given Putin the gall to invade, but the way I see it being ambiguous about it didn't help at all.