Package cairo was not found in the pkg-config search path. Node j.s install canvas issue

后端 未结 9 705
逝去的感伤
逝去的感伤 2020-12-01 05:46

I am having a problem installing installing the canvas module in node..It seems to be something with cairo I am getting this error...

npm http GET https://re         


        
相关标签:
9条回答
  • 2020-12-01 06:41

    If anyone is still having this problem and found this page, the following works for CentOS 6.6:

    sudo yum install cairo cairo-devel
    

    Basically the solution is you need to install the development package as well as the regular package (the best answer here does the same thing - except is for Ubuntu - every distro can be different).

    0 讨论(0)
  • 2020-12-01 06:42

    I followed the steps given by @Piyush. But I needed an extra step to make it work. I'm using OS X 10.14.5

    So this is what I followed.

    brew install pkg-config
    brew install cairo
    pkg-config --atleast-version=1.12.2 cairo
    export PKG_CONFIG_PATH=/usr/X11/lib/pkgconfig/
    export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:/usr/local/opt/libffi/lib/pkgconfig"
    npm install canvas

    0 讨论(0)
  • 2020-12-01 06:43

    Had the same problem on OS X 10.11.2 while installing qrcode package.

    Solved by installing these ones:

    brew install cairo
    brew install pkg-config
    xcode-select --install
    
    0 讨论(0)
提交回复
热议问题