When you get an error No package 'libxml-2.0' found in your Ubuntu/Debian or CentOS or MacOS just execute the command,

Ubuntu/Debian:
Update the packages using the command below,

$ sudo apt update
$ sudo apt-get install libxml2-dev

MacOS:
 
$ brew install libxml2

CentOS
 
$ yum install libxml2-devel