"I don't like traveling alone."
Translation:Mi ne ŝatas vojaĝi sola.
There's no reason why couldn't sole modify an infinitive. There would be some ambiguity as to which verb it modifies, but in both cases it does make sense: vojaĝi sole (=neakompanate) or ŝati sole vojaĝi (=ŝati nur vojaĝi). With sole at the end, the word order would strongly suggest the first interpretation and not the second; and that's how it sounds the most natural to me. But because of that potential ambiguity, some prefer to use the adjective, which is equally fine (and equally ambiguous in meaning if you disregard the word order!).
Just chiming in because there is a lot of discussion on this thread. I hope I can add some clarity rather than add to the confusion. Mostly I want to agree with Arbaro and Jxetkubo.
People who don't want to take my word for it can check PMEG and PIV, but basically both sola and sole can be correct, but my advice is to use sola to avoid ambiguity. Consider these examples from PMEG.
- Ili iris sole tien. = Ili iris nur tien.
- Ili iris solaj tien. = Ili iris tien sen akompano.
But before we get too hard and fast here, consider this Zamehofa example from PIV.
- malfeliĉo malofte venas sole
The explanation is that here it means that misfortune seldom comes unaccompanied or without outside help.
And another example from PIV looks similar but here sole means "only".
- li venos sole dimanĉe
And it's exactly because of this ambiguity that I suggest using sola in the original sentence we're discussing.
I think fair arguments can be made that either sola or sole can be used here. You can say that sola is describing mi, the subject of the sentence, or you can say that sole attaches to vojaĝi, essentially saying, "to travel in an alone kind of way."
This is one of these areas where language and thought gets somewhat murky, but using either sole or sola here will most likely communicate what it is meant.
There's no question that this is how everyone wants these words to work (or at least assumes that this is how the work). The problem is that according to Esperanto grammar, they ought to mean exactly the same thing, except that one of them should be an adjective (sola) and one of them an adverb (sole). Adjectives and adverbs are chosen according to what part of speech they're supposed to modify. "Sola" as an adjective would have to modify a noun or pronoun. But in the English sentence "alone" is not modifying a noun or pronoun, it's modifying a verb, that meaning and usage ought to require an adverb (sole). I think the problem is that people are translating words rather than recasting the thought in an Esperanto idiom under Esperanto logic.