I'd say only the first one is correct.
A book called "English Grammar in Use" is British, and it would put hyphens on both sides of "year."
The last three are definitely unacceptable 'coz once a bunch of words precedes a Noun, they are no longer Nouns but an Adjective. And Adjectives can't become plural in English.
So:
He's 6 yearS old. But... He's a 6-year-old boy.
It's 5 thousand dollarS. But... It's a 5-thousand-dollar bag.
It's 2 hours. But... It's a 2-hour-trip.
Similarly, we say "apple tree" but not "apples tree."
Personally, I believe this is also the reason why they're strung up together like that - to become just one unit describing the Noun (in this case, "computer").