The factbook "Rey's Survival Guide" strongly implies that she learned to speak Wookiee using the computer language tapes that she found during her salvage of Rebel ships, in much the same way that she learned to speak droidspeak.
What do I do when I'm home? Mostly, I refurbish gear at my workbench - it costs too much to make extensive repairs at Unkar's
washing tables in Niima. I have an old Y-wing computer display I use
to study schematics of rebel and Imperial starships and run flight
sims. I practice alien languages and droidspeak so I can talk to
people in Niima. And I sleep - I made myself a hammock when I was
just a kid. At first it was huge, and I would feel lost in the middle
of it. Now it fits more snugly.
She apparently used these language skills to speak to a group of itinerant Wookiee Traders in Niima, strongly implying that she already spoke their language.
I'd heard of Chewbacca from some Wookiee traders who'd stopped off at
Jakku. They said he was an amazing hyperspace scout and smart
smuggler, with a reckless human first mate who was always getting him
in trouble. I never dreamed I'd get to meet them.