Written and first released by Carole King (1971).
Hit version by James Taylor (US #1/UK #4 1971).
From the wiki: “‘You’ve Got a Friend’ was written by Carole King, and included on both her album Tapestry and James Taylor’s album Mud Slide Slim, recorded simultaneously in 1971 with shared musicians. Tapestry was the first of the two albums to be released, in February 1971. Mud Slide Slim would be released in March 1971.
“‘Friend’ was composed by King during the January 1971 recording sessions that produced Tapestry in tandem with Taylor’s own album sessions. King, Danny Kortchmar, Joni Mitchell and Taylor performed on both albums. King said in a 1972 interview that she ‘didn’t write [‘You’ve Got a Friend’] with James or anybody really specifically in mind. But when James heard it he really liked it and wanted to record it.’ But, according to Taylor, King told him that the song was a response to a line in Taylor’s earlier song ‘Fire and Rain’ that ‘I’ve seen lonely times when I could not find a friend.’
“Taylor’s version was released as a single, and reached #1 on the Billboard Hot 100 and #4 on the UK Singles Chart, and won Grammy Awards both for Taylor (Best Male Pop Vocal Performance) and King (Song of the Year) in 1972.
“During the recording sessions, Taylor offered to his former Apple Records labelmate Mary Hopkin a chance to record the song, which she turned down, a decision she later said she strongly regretted.
“In his review of [Carole King’s album] Tapestry, Rolling Stone critic Jon Landau called ‘You’ve Got a Friend’ King’s ‘most perfect new song.’ He particularly praised how the melody and lyrics support each other, and the ‘gorgeous, righteous rock melody’ of the ending lyrics. Mojo considered the song to probably be ‘the core of Tapestry.'”
James Taylor, “You’ve Got a Friend” (1971):