The 33-year-old’s team Dimension Data confirmed that he had been “unknowingly training and racing” with it for a number of months.
The Epstein-Barr virus is most commonly known as being the cause of glandular fever.
Cavendish said in a statement on Dimension Data’s website: “This season, I’ve not felt physically myself and despite showing good numbers on the bike, I have felt that there’s been something not right.”
“Given this and on the back of these medical results, I’m glad to now finally have some clarity as to why I haven’t been able to perform at my optimum level during this time.
“Having received expert medical advice as a result of the findings, I’ve been advised to take a period of total rest in order to fully recover.
“I’m now looking forward to taking the time necessary in order to get back to 100% fitness, before then returning to racing again at peak physical condition.
“I’d like to thank everyone for the incredible support I’ve received and I look forward to seeing you all out on the road again soon.”
Cavendish has won thirty Tour de France stages in his career, putting him second on the all-time list.
He had to withdraw from the Commonwealth Games in 2018 following a crash at the Milan-San Remo race in March.