Sahih al-Bukhari, Volume 1, Book 4, Hadith 235 (USC-MSA)

Narrated Anas: Prior to the construction of the mosque, the Prophet offered the prayers at sheep-folds.

حَدَّثَنَا آدَمُ، قَالَ حَدَّثَنَا شُعْبَةُ، قَالَ أَخْبَرَنَا أَبُو التَّيَّاحِ، يَزِيدُ بْنُ حُمَيْدٍ عَنْ أَنَسٍ، قَالَ كَانَ النَّبِيُّ صلى الله عليه وسلم يُصَلِّي قَبْلَ أَنْ يُبْنَى الْمَسْجِدُ فِي مَرَابِضِ الْغَنَمِ‏.‏

sunnah.com