No genes' ID in peak annotations during ChiP-Seq with ChIPpeakAnno R package
I had the same problem.
This how I solved it, I found the solution somewhere here, I don't remember where, and it worked for me.

macs.anno &lt;- annotatePeakInBatch(gr_broadPeak, AnnotationData=TSS.human.GRCh38, 
                                     output="both", maxgap=5000L)
 macs.annoL=addGeneIDs(macs.anno,"org.Hs.eg.db",c("symbol", "genename","entrez_id"))
 macs.annoDF=as.data.frame(macs.annoL)
   result=macs.annoDF[which(macs.annoDF$symbol!="NA"),]