Libraries came first before books according to recent ancient Egyptian archaeological finds.
Early Egyptian libraries lent out literature that came pressed and fired into clay tablets.
It took a while for ancient civilizations to discover and invent paper.