2017-11-03 libxml2 and Homebrew and Perl

I installed a new Perl and needed to install XML::LibXML.

cpanm XML::LibXML

But that didn’t work. I got an error and in the log file it would say:

running xml2-config...The installed version of libxml2 VERSION 2.9.4
 is not compatible with XML::LibXML (and probably buggy)!

At first I thought it was Homebrew.

brew upgrade libxml2

But the error remained. The key is to temporarily change the PATH:

export PATH="/usr/local/opt/libxml2/bin:$PATH"
cpanm XML::LibXML

This makes sure the correct version of xml2-config gets called.

Tags:

Comments


Please make sure you contribute only your own work, or work licensed under the GNU Free Documentation License. See Info for text formatting rules. You can edit the comment page if you need to fix typos. You can subscribe to new comments by email without leaving a comment.

To save this page you must answer this question:

Please say HELLO.