{"action":"opened","issue":{"url":"https://api.github.com/repos/lightningtgc/blog/issues/2","repository_url":"https://api.github.com/repos/lightningtgc/blog","labels_url":"https://api.github.com/repos/lightningtgc/blog/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/lightningtgc/blog/issues/2/comments","events_url":"https://api.github.com/repos/lightningtgc/blog/issues/2/events","html_url":"https://github.com/lightningtgc/blog/issues/2","id":151112783,"number":2,"title":"Mac下安装node-canvas","user":{"login":"lightningtgc","id":1381865,"avatar_url":"https://avatars.githubusercontent.com/u/1381865?v=3","gravatar_id":"","url":"https://api.github.com/users/lightningtgc","html_url":"https://github.com/lightningtgc","followers_url":"https://api.github.com/users/lightningtgc/followers","following_url":"https://api.github.com/users/lightningtgc/following{/other_user}","gists_url":"https://api.github.com/users/lightningtgc/gists{/gist_id}","starred_url":"https://api.github.com/users/lightningtgc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lightningtgc/subscriptions","organizations_url":"https://api.github.com/users/lightningtgc/orgs","repos_url":"https://api.github.com/users/lightningtgc/repos","events_url":"https://api.github.com/users/lightningtgc/events{/privacy}","received_events_url":"https://api.github.com/users/lightningtgc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-26T11:47:16Z","updated_at":"2016-04-26T11:48:22Z","closed_at":null,"body":"# Mac下安装[node-canvas](https://github.com/Automattic/node-canvas)\r\n### 第一步：安装pkg-config\r\n\r\n在终端运行：\r\n```\r\ncurl https://pkg-config.freedesktop.org/releases/pkg-config-0.28.tar.gz -o pkgconfig.tgz\r\n\r\ntar -zxf pkgconfig.tgz && cd pkg-config-0.28\r\n\r\n./configure --with-internal-glib && make install\r\n```\r\n\r\n### 第二步：安装Pixman\r\n```\r\ncurl http://www.cairographics.org/releases/pixman-0.34.0.tar.gz -o pixman.tar.gz\r\n\r\n$ tar -zxf pixman.tar.gz && cd pixman-0.34.0/\r\n\r\n./configure --prefix=/usr/local --disable-dependency-tracking\r\n\r\nmake install\r\n```\r\n\r\n### 第三步：安装Cairo\r\n\r\n先装它的依赖[libpng & libjpeg](http://ethan.tira-thompson.com/Mac_OS_X_Ports.html)  :  [点击这里下载](http://ethan.tira-thompson.com/Mac_OS_X_Ports_files/libjpeg-libpng%20%28universal%29.dmg)\r\n\r\n再执行：\r\n```\r\ncurl http://cairographics.org/releases/cairo-1.12.18.tar.xz -o cairo.tar.xz\r\n\r\ntar -xf cairo.tar.xz && cd cairo-1.12.18\r\n\r\n./configure --prefix=/usr/local --disable-dependency-tracking\r\n\r\nmake install\r\n```\r\n\r\n### 最后：安装node-canvas\r\n\r\n```\r\nnpm install canvas\r\n\r\n```"}}