I don't think it really counts as a spoiler if you learn it by reading an entire novel. That way, you're still getting everything in the context of a complete story, serving the dramatic purpose that it was intended to serve. So the experience isn't spoiled, in the literal sense of being ruined and made unfulfilling. You still get a complete storytelling experience, just in prose form. Seeing the movie later just fills in some details (and often the novelization will add details not in the movie).
In my youth, I didn't get taken to the movies very often, but I read prolifically. So I read plenty of novelizations before seeing the respective movies, and it was a fairly normal experience for me. To me, reading the novel didn't spoil the experience of the movie, it just whetted my appetite for it. I read the ST:TMP and TWOK novels before seeing the movies (I remember finding it startling and ridiculous how tiny the Genesis torpedo turned out to be, since I figured something that powerful had to be more missile-sized), as well as others such as The Black Hole
and Fantastic Voyage
. I read the novelization of E.T.
many, many years before I finally saw the movie on TV (and loathed it with a fierce passion). And I never would've had a clue what was going on in 2001: A Space Odyssey
if I hadn't read the book first.
I can't recall whether I read or watched Star Wars
(1977) first, but I'm pretty certain that The Empire Strikes Back
was one I saw in the theater first, because I remember coming out of the theater insisting that Vader had to be lying about the whole "I am your father" thing.