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

后端 未结 9 747
逝去的感伤
逝去的感伤 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:32

    I was also facing same issue on mac so I have tried these steps & I got solution

    Mac OSX Version >=10.7.5 node -v = v0.8.12

    $ brew install cairo
    $ pkg-config --atleast-version=1.12.2 cairo
    $ echo $?
    

    If it returns a 1 you will need to set the PKG_CONFIG_PATH environment variable so cairo.pc and fontconfig.pc can be found

    $ locate cairo.pc
    $ export PKG_CONFIG_PATH=/usr/X11/lib/pkgconfig/
    

    Running pkg-config again ...

    $ pkg-config --atleast-version=1.12.2 cairo
    
    $ echo $?
    

    If it returns a 0 then all is well in the hood.

    $ npm install canvas
    

提交回复
热议问题