Homebrew / legacy-homebrew

💀 The former home of Homebrew/homebrew (deprecated)
https://brew.sh
26.99k stars 11.36k forks source link

homebrewed cairo does not help with `npm install canvas` #25533

Closed elgs closed 10 years ago

elgs commented 10 years ago

Previously I installed cairo with macports, and it helped with installing the npm package canvas. Now I installed cairo with homebrew, but it seems the homebrewed cairo does not help to install the npm package canvas.

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/0.10.24/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'install',
1 verbose cli   'canvas' ]
2 info using npm@1.3.21
3 info using node@v0.10.24
4 verbose cache add [ 'canvas', null ]
5 verbose cache add name=undefined spec="canvas" args=["canvas",null]
6 verbose parsed url { protocol: null,
6 verbose parsed url   slashes: null,
6 verbose parsed url   auth: null,
6 verbose parsed url   host: null,
6 verbose parsed url   port: null,
6 verbose parsed url   hostname: null,
6 verbose parsed url   hash: null,
6 verbose parsed url   search: null,
6 verbose parsed url   query: null,
6 verbose parsed url   pathname: 'canvas',
6 verbose parsed url   path: 'canvas',
6 verbose parsed url   href: 'canvas' }
7 silly lockFile 7aa15835-canvas canvas
8 verbose lock canvas /Volumes/User/Home/.npm/7aa15835-canvas.lock
9 silly lockFile 7aa15835-canvas canvas
10 silly lockFile 7aa15835-canvas canvas
11 verbose addNamed [ 'canvas', '' ]
12 verbose addNamed [ null, '*' ]
13 silly lockFile 7328b956-canvas canvas@
14 verbose lock canvas@ /Volumes/User/Home/.npm/7328b956-canvas.lock
15 silly addNameRange { name: 'canvas', range: '*', hasData: false }
16 verbose url raw canvas
17 verbose url resolving [ 'https://registry.npmjs.org/', './canvas' ]
18 verbose url resolved https://registry.npmjs.org/canvas
19 info trying registry request attempt 1 at 15:14:16
20 verbose etag "CR28DL9UFFPDZHNR9CX5LQ9D5"
21 http GET https://registry.npmjs.org/canvas
22 http 304 https://registry.npmjs.org/canvas
23 silly registry.get cb [ 304,
23 silly registry.get   { date: 'Sun, 29 Dec 2013 07:14:18 GMT',
23 silly registry.get     server: 'Apache',
23 silly registry.get     connection: 'Keep-Alive',
23 silly registry.get     'keep-alive': 'timeout=10, max=50',
23 silly registry.get     etag: '"CR28DL9UFFPDZHNR9CX5LQ9D5"',
23 silly registry.get     vary: 'Accept' } ]
24 verbose etag canvas from cache
25 silly addNameRange number 2 { name: 'canvas', range: '*', hasData: true }
26 silly addNameRange versions [ 'canvas',
26 silly addNameRange   [ '0.0.1',
26 silly addNameRange     '0.0.2',
26 silly addNameRange     '0.0.3',
26 silly addNameRange     '0.0.4',
26 silly addNameRange     '0.0.5',
26 silly addNameRange     '0.0.6',
26 silly addNameRange     '0.0.7',
26 silly addNameRange     '0.0.8',
26 silly addNameRange     '0.1.0',
26 silly addNameRange     '0.2.0',
26 silly addNameRange     '0.2.1',
26 silly addNameRange     '0.3.0',
26 silly addNameRange     '0.3.1',
26 silly addNameRange     '0.3.2',
26 silly addNameRange     '0.3.3',
26 silly addNameRange     '0.4.0',
26 silly addNameRange     '0.4.1',
26 silly addNameRange     '0.4.2',
26 silly addNameRange     '0.4.3',
26 silly addNameRange     '0.5.0',
26 silly addNameRange     '0.5.1',
26 silly addNameRange     '0.5.2',
26 silly addNameRange     '0.5.3',
26 silly addNameRange     '0.5.4',
26 silly addNameRange     '0.6.0',
26 silly addNameRange     '0.7.0',
26 silly addNameRange     '0.7.1',
26 silly addNameRange     '0.7.2',
26 silly addNameRange     '0.7.3',
26 silly addNameRange     '0.8.0',
26 silly addNameRange     '0.8.1',
26 silly addNameRange     '0.8.2',
26 silly addNameRange     '0.8.3',
26 silly addNameRange     '0.9.0',
26 silly addNameRange     '0.10.0',
26 silly addNameRange     '0.10.1',
26 silly addNameRange     '0.10.2',
26 silly addNameRange     '0.10.3',
26 silly addNameRange     '0.11.0',
26 silly addNameRange     '0.11.1',
26 silly addNameRange     '0.11.2',
26 silly addNameRange     '0.11.3',
26 silly addNameRange     '0.12.0',
26 silly addNameRange     '0.12.1',
26 silly addNameRange     '0.13.0',
26 silly addNameRange     '0.13.1',
26 silly addNameRange     '1.0.0',
26 silly addNameRange     '1.0.1',
26 silly addNameRange     '1.0.2',
26 silly addNameRange     '1.0.3',
26 silly addNameRange     '1.0.4',
26 silly addNameRange     '1.1.0',
26 silly addNameRange     '1.1.1',
26 silly addNameRange     '1.1.2' ] ]
27 verbose addNamed [ 'canvas', '1.1.2' ]
28 verbose addNamed [ '1.1.2', '1.1.2' ]
29 silly lockFile 476e28e2-canvas-1-1-2 canvas@1.1.2
30 verbose lock canvas@1.1.2 /Volumes/User/Home/.npm/476e28e2-canvas-1-1-2.lock
31 silly lockFile 476e28e2-canvas-1-1-2 canvas@1.1.2
32 silly lockFile 476e28e2-canvas-1-1-2 canvas@1.1.2
33 silly lockFile 7328b956-canvas canvas@
34 silly lockFile 7328b956-canvas canvas@
35 silly resolved [ { name: 'canvas',
35 silly resolved     description: 'Canvas graphics API backed by Cairo',
35 silly resolved     version: '1.1.2',
35 silly resolved     author: { name: 'TJ Holowaychuk', email: 'tj@learnboost.com' },
35 silly resolved     keywords:
35 silly resolved      [ 'canvas',
35 silly resolved        'graphic',
35 silly resolved        'graphics',
35 silly resolved        'pixman',
35 silly resolved        'cairo',
35 silly resolved        'image',
35 silly resolved        'images',
35 silly resolved        'pdf' ],
35 silly resolved     homepage: 'https://github.com/learnboost/node-canvas',
35 silly resolved     repository: { type: 'git', url: 'git://github.com/learnboost/node-canvas' },
35 silly resolved     scripts: { test: 'make test', install: 'node-gyp rebuild' },
35 silly resolved     dependencies: { nan: '~0.4.1' },
35 silly resolved     devDependencies: { express: '3.0', jade: '0.28.1', mocha: '*', should: '*' },
35 silly resolved     engines: { node: '>= 0.6.0' },
35 silly resolved     main: './lib/canvas.js',
35 silly resolved     gypfile: true,
35 silly resolved     readme: '# node-canvas\n\n Node canvas is a [Cairo](http://cairographics.org/) backed Canvas implementation for [NodeJS](http://nodejs.org).\n\n## Authors\n\n  - TJ Holowaychuk ([visionmedia](http://github.com/visionmedia))\n\n## Installation\n\n    $ npm install canvas\n\nUnless previously installed you\'ll _need_ __Cairo__. For system-specific installation view the [Wiki](https://github.com/LearnBoost/node-canvas/wiki/_pages).\n\n## Screencasts\n\n  - [Introduction](http://screenr.com/CTk)\n\n## Example\n\n```javascript\nvar Canvas = require(\'canvas\')\n  , canvas = new Canvas(200,200)\n  , ctx = canvas.getContext(\'2d\');\n\nctx.font = \'30px Impact\';\nctx.rotate(.1);\nctx.fillText("Awesome!", 50, 100);\n\nvar te = ctx.measureText(\'Awesome!\');\nctx.strokeStyle = \'rgba(0,0,0,0.5)\';\nctx.beginPath();\nctx.lineTo(50, 102);\nctx.lineTo(50 + te.width, 102);\nctx.stroke();\n\nconsole.log(\'<img src="\' + canvas.toDataURL() + \'" />\');\n```\n\n## Non-Standard API\n\n node-canvas extends the canvas API to provide interfacing with node, for example streaming PNG data, converting to a `Buffer` instance, etc. Among the interfacing API, in some cases the drawing API has been extended for SSJS image manipulation / creation usage, however keep in mind these additions may fail to render properly within browsers.\n\n### Image#src=Buffer\n\n node-canvas adds `Image#src=Buffer` support, allowing you to read images from disc, redis, etc and apply them via `ctx.drawImage()`. Below we draw scaled down squid png by reading it from the disk with node\'s I/O.\n\n```javascript\nfs.readFile(__dirname + \'/images/squid.png\', function(err, squid){\n  if (err) throw err;\n  img = new Image;\n  img.src = squid;\n  ctx.drawImage(img, 0, 0, img.width / 4, img.height / 4);\n});\n```\n\n Below is an example of a canvas drawing it-self as the source several time:\n\n```javascript\nvar img = new Image;\nimg.src = canvas.toBuffer();\nctx.drawImage(img, 0, 0, 50, 50);\nctx.drawImage(img, 50, 0, 50, 50);\nctx.drawImage(img, 100, 0, 50, 50);\n```\n\n### Image#dataMode\n\nnode-canvas adds `Image#dataMode` support, which can be used to opt-in to mime data tracking of images (currently only JPEGs).\n\nWhen mime data is tracked, in PDF mode JPEGs can be embedded directly into the output, rather than being re-encoded into PNG. This can drastically reduce filesize, and speed up rendering.\n\n```javascript\nvar img = new Image;\nimg.dataMode = Image.MODE_IMAGE; // Only image data tracked\nimg.dataMode = Image.MODE_MIME; // Only mime data tracked\nimg.dataMode = Image.MODE_MIME | Image.MODE_IMAGE; // Both are tracked\n```\n\nIf image data is not tracked, and the Image is drawn to an image rather than a PDF canvas, the output will be junk. Enabling mime data tracking has no benefits (only a slow down) unless you are generating a PDF.\n\n### Canvas#pngStream()\n\n  To create a `PNGStream` simply call `canvas.pngStream()`, and the stream will start to emit _data_ events, finally emitting _end_ when finished. If an exception occurs the _error_ event is emitted.\n\n```javascript\nvar fs = require(\'fs\')\n  , out = fs.createWriteStream(__dirname + \'/text.png\')\n  , stream = canvas.pngStream();\n\nstream.on(\'data\', function(chunk){\n  out.write(chunk);\n});\n\nstream.on(\'end\', function(){\n  console.log(\'saved png\');\n});\n```\n\nCurrently _only_ sync streaming is supported, however we plan on supporting async streaming as well (of course :) ). Until then the `Canvas#toBuffer(callback)` alternative is async utilizing `eio_custom()`.\n\n### Canvas#jpegStream() and Canvas#syncJPEGStream()\n\nYou can likewise create a `JPEGStream` by calling `canvas.jpegStream()` with\nsome optional parameters; functionality is otherwise identical to\n`pngStream()`. See `examples/crop.js` for an example.\n\n_Note: At the moment, `jpegStream()` is the same as `syncJPEGStream()`, both\nare synchronous_\n\n```javascript\nvar stream = canvas.JPEGStream({\n    bufsize: 4096 // output buffer size in bytes, default: 4096 \n  , quality: 75 // JPEG quality (0-100) default: 75\n  , progressive: false // true for progressive compression, default: false\n});\n```\n\n### Canvas#toBuffer()\n\nA call to `Canvas#toBuffer()` will return a node `Buffer` instance containing all of the PNG data.\n\n```javascript\ncanvas.toBuffer();\n```\n\n### Canvas#toBuffer() async\n\nOptionally we may pass a callback function to `Canvas#toBuffer()`, and this process will be performed asynchronously, and will `callback(err, buf)`.\n\n```javascript\ncanvas.toBuffer(function(err, buf){\n\n});\n```\n\n### Canvas#toDataURL() async\n\nOptionally we may pass a callback function to `Canvas#toDataURL()`, and this process will be performed asynchronously, and will `callback(err, str)`.\n\n```javascript\ncanvas.toDataURL(function(err, str){\n\n});\n```\n\nor specify the mime type:\n\n```javascript\ncanvas.toDataURL(\'image/png\', function(err, str){\n\n});\n```\n\n### CanvasRenderingContext2d#patternQuality\n\nGiven one of the values below will alter pattern (gradients, images, etc) render quality, defaults to _good_.\n\n  - fast\n  - good\n  - best\n  - nearest\n  - bilinear\n\n### CanvasRenderingContext2d#textDrawingMode\n\nCan be either `path` or `glyph`. Using `glyph` is much faster than `path` for drawing, and when using a PDF context will embed the text natively, so will be selectable and lower filesize. The downside is that cairo does not have any subpixel precision for `glyph`, so this will be noticeably lower quality for text positioning in cases such as rotated text. Also, strokeText in `glyph` will act the same as fillText, except using the stroke style for the fill.\n\nDefaults to _path_.\n\nThis property is tracked as part of the canvas state in save/restore.\n\n### CanvasRenderingContext2d#filter\n\nLike `patternQuality`, but applies to transformations effecting more than just patterns. Defaults to _good_.\n\n  - fast\n  - good\n  - best\n  - nearest\n  - bilinear\n\n### Global Composite Operations\n\nIn addition to those specified and commonly implemented by browsers, the following have been added:\n\n  - multiply\n  - screen\n  - overlay\n  - hard-light\n  - soft-light\n  - hsl-hue\n  - hsl-saturation\n  - hsl-color\n  - hsl-luminosity\n\n## Anti-Aliasing\n\n Set anti-aliasing mode\n\n - default\n - none\n - gray\n - subpixel\n\n For example:\n\n```javascript\nctx.antialias = \'none\';\n```\n\n## PDF Support\n\n  Basic PDF support was added in 0.11.0. Make sure to install cairo with `--enable-pdf=yes` for the PDF backend. node-canvas must know that it is creating\n  a PDF on initialization, using the "pdf" string:\n\n```js\nvar canvas = new Canvas(200, 500, \'pdf\');\n```\n\n An additional method `.addPage()` is then available to create \n multiple page PDFs:\n\n```js\nctx.font = \'22px Helvetica\';\nctx.fillText(\'Hello World\', 50, 80);\nctx.addPage();\n\nctx.font = \'22px Helvetica\';\nctx.fillText(\'Hello World 2\', 50, 80);\nctx.addPage();\n\nctx.font = \'22px Helvetica\';\nctx.fillText(\'Hello World 3\', 50, 80);\nctx.addPage();\n```\n\n## Benchmarks\n\n Although node-canvas is extremely new, and we have not even begun optimization yet it is already quite fast. For benchmarks vs other node canvas implementations view this [gist](https://gist.github.com/664922), or update the submodules and run `$ make benchmark` yourself.\n\n## Contribute\n\n Want to contribute to node-canvas? patches for features, bug fixes, documentation, examples and others are certainly welcome. Take a look at the [issue queue](https://github.com/LearnBoost/node-canvas/issues) for existing issues.\n\n## Examples\n\n Examples are placed in _./examples_, be sure to check them out! most produce a png image of the same name, and others such as _live-clock.js_ launch an http server to be viewed in the browser.\n\n## Testing\n\nIf you have not previously, init git submodules:\n\n    $ git submodule update --init\n\nBuild node-canvas:\n\n    $ node-waf configure build\n\nUnit tests:\n\n    $ make test\n\nVisual tests:\n\n    $ make test-server\n\n## Versions\n\nTested with and designed for:\n\n  - node 0.4.2\n  - cairo 1.8.6\n\nFor node 0.2.x `node-canvas` <= 0.4.3 may be used,\n0.5.0 and above are designed for node 0.4.x only.\n\n## Contributors\n\n```\nproject  : node-canvas\n repo age : 1 year, 11 months\n active   : 120 days\n commits  : 963\n files    : 72\n authors  : \n   816\tTj Holowaychuk          84.7%\n    58\tTJ Holowaychuk          6.0%\n    23\tc-spencer               2.4%\n    16\tNathan Rajlich          1.7%\n    12\tatomizer                1.2%\n     6\tElijah Hamovitz         0.6%\n     5\tLuigi Pinca             0.5%\n     5\tRobert Sköld            0.5%\n     4\tobarthel                0.4%\n     3\tDon Park                0.3%\n     2\tAndreas Botsikas        0.2%\n     2\tGabriel Falcao          0.2%\n     1\tBrian McKinney          0.1%\n     1\tSeiya Konno             0.1%\n     1\tSyoyo Fujita            0.1%\n     1\tMarcello Bastea-Forte   0.1%\n     1\tTharit                  0.1%\n     1\tKonstantin Käfer        0.1%\n     1\tTom Carden              0.1%\n     1\tWalt Lin                0.1%\n     1\tDavid Björklund         0.1%\n     1\tBrian White             0.1%\n     1\tPhilippe Plantier       0.1%\n```\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2010 LearnBoost &lt;dev@learnboost.ca&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\'Software\'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \'AS IS\', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n',
35 silly resolved     readmeFilename: 'Readme.md',
35 silly resolved     bugs: { url: 'https://github.com/learnboost/node-canvas/issues' },
35 silly resolved     _id: 'canvas@1.1.2',
35 silly resolved     _from: 'canvas@' } ]
36 info install canvas@1.1.2 into /Volumes/User/Home/Desktop
37 info installOne canvas@1.1.2
38 info /Volumes/User/Home/Desktop/node_modules/canvas unbuild
39 verbose tar unpack /Volumes/User/Home/.npm/canvas/1.1.2/package.tgz
40 silly lockFile aa24ebcf-Home-Desktop-node-modules-canvas tar:///Volumes/User/Home/Desktop/node_modules/canvas
41 verbose lock tar:///Volumes/User/Home/Desktop/node_modules/canvas /Volumes/User/Home/.npm/aa24ebcf-Home-Desktop-node-modules-canvas.lock
42 silly lockFile 2869c85a-ome-npm-canvas-1-1-2-package-tgz tar:///Volumes/User/Home/.npm/canvas/1.1.2/package.tgz
43 verbose lock tar:///Volumes/User/Home/.npm/canvas/1.1.2/package.tgz /Volumes/User/Home/.npm/2869c85a-ome-npm-canvas-1-1-2-package-tgz.lock
44 silly gunzTarPerm modes [ '755', '644' ]
45 silly gunzTarPerm extractEntry package.json
46 silly gunzTarPerm extractEntry .npmignore
47 silly gunzTarPerm extractEntry index.js
48 silly gunzTarPerm extractEntry binding.gyp
49 silly gunzTarPerm extractEntry Makefile
50 silly gunzTarPerm extractEntry Readme.md
51 silly gunzTarPerm extractEntry .gitmodules
52 silly gunzTarPerm extractEntry .travis.yml
53 silly gunzTarPerm extractEntry install
54 silly gunzTarPerm extractEntry lib/bindings.js
55 silly gunzTarPerm extractEntry lib/canvas.js
56 silly gunzTarPerm extractEntry lib/context2d.js
57 silly gunzTarPerm extractEntry lib/image.js
58 silly gunzTarPerm extractEntry lib/jpegstream.js
59 silly gunzTarPerm extractEntry lib/pixelarray.js
60 silly gunzTarPerm extractEntry lib/pngstream.js
61 silly gunzTarPerm extractEntry History.md
62 silly gunzTarPerm extractEntry src/Image.h
63 silly gunzTarPerm extractEntry src/Canvas.cc
64 silly gunzTarPerm extractEntry src/CanvasGradient.cc
65 silly gunzTarPerm extractEntry src/CanvasGradient.h
66 silly gunzTarPerm extractEntry src/CanvasPattern.cc
67 silly gunzTarPerm extractEntry src/CanvasPattern.h
68 silly gunzTarPerm extractEntry src/CanvasRenderingContext2d.cc
69 silly gunzTarPerm extractEntry src/CanvasRenderingContext2d.h
70 silly gunzTarPerm extractEntry src/FontFace.cc
71 silly gunzTarPerm extractEntry src/FontFace.h
72 silly gunzTarPerm extractEntry src/Image.cc
73 silly gunzTarPerm extractEntry src/Canvas.h
74 silly gunzTarPerm extractEntry src/ImageData.cc
75 silly gunzTarPerm extractEntry src/ImageData.h
76 silly gunzTarPerm extractEntry src/JPEGStream.h
77 silly gunzTarPerm extractEntry src/PNG.h
78 silly gunzTarPerm extractEntry src/PixelArray.cc
79 silly gunzTarPerm extractEntry src/PixelArray.h
80 silly gunzTarPerm extractEntry src/Point.h
81 silly gunzTarPerm extractEntry src/closure.h
82 silly gunzTarPerm extractEntry src/color.cc
83 silly gunzTarPerm extractEntry src/color.h
84 silly gunzTarPerm extractEntry src/init.cc
85 silly gunzTarPerm extractEntry util/cairo_include.sh
86 silly gunzTarPerm extractEntry util/has_cairo_freetype.sh
87 silly gunzTarPerm extractEntry util/has_lib.sh
88 silly gunzTarPerm extractEntry util/lib_lookup.sh
89 silly lockFile aa24ebcf-Home-Desktop-node-modules-canvas tar:///Volumes/User/Home/Desktop/node_modules/canvas
90 silly lockFile aa24ebcf-Home-Desktop-node-modules-canvas tar:///Volumes/User/Home/Desktop/node_modules/canvas
91 silly lockFile 2869c85a-ome-npm-canvas-1-1-2-package-tgz tar:///Volumes/User/Home/.npm/canvas/1.1.2/package.tgz
92 silly lockFile 2869c85a-ome-npm-canvas-1-1-2-package-tgz tar:///Volumes/User/Home/.npm/canvas/1.1.2/package.tgz
93 info preinstall canvas@1.1.2
94 verbose readDependencies using package.json deps
95 verbose readDependencies using package.json deps
96 verbose cache add [ 'nan@~0.4.1', null ]
97 verbose cache add name=undefined spec="nan@~0.4.1" args=["nan@~0.4.1",null]
98 verbose parsed url { protocol: null,
98 verbose parsed url   slashes: null,
98 verbose parsed url   auth: null,
98 verbose parsed url   host: null,
98 verbose parsed url   port: null,
98 verbose parsed url   hostname: null,
98 verbose parsed url   hash: null,
98 verbose parsed url   search: null,
98 verbose parsed url   query: null,
98 verbose parsed url   pathname: 'nan@~0.4.1',
98 verbose parsed url   path: 'nan@~0.4.1',
98 verbose parsed url   href: 'nan@~0.4.1' }
99 verbose cache add name="nan" spec="~0.4.1" args=["nan","~0.4.1"]
100 verbose parsed url { protocol: null,
100 verbose parsed url   slashes: null,
100 verbose parsed url   auth: null,
100 verbose parsed url   host: null,
100 verbose parsed url   port: null,
100 verbose parsed url   hostname: null,
100 verbose parsed url   hash: null,
100 verbose parsed url   search: null,
100 verbose parsed url   query: null,
100 verbose parsed url   pathname: '~0.4.1',
100 verbose parsed url   path: '~0.4.1',
100 verbose parsed url   href: '~0.4.1' }
101 verbose addNamed [ 'nan', '~0.4.1' ]
102 verbose addNamed [ null, '>=0.4.1-0 <0.5.0-0' ]
103 silly lockFile d65817a5-nan-0-4-1 nan@~0.4.1
104 verbose lock nan@~0.4.1 /Volumes/User/Home/.npm/d65817a5-nan-0-4-1.lock
105 silly addNameRange { name: 'nan', range: '>=0.4.1-0 <0.5.0-0', hasData: false }
106 verbose url raw nan
107 verbose url resolving [ 'https://registry.npmjs.org/', './nan' ]
108 verbose url resolved https://registry.npmjs.org/nan
109 info trying registry request attempt 1 at 15:14:18
110 verbose etag "EVE9FQOY8QOVPL39YRIEVNB6R"
111 http GET https://registry.npmjs.org/nan
112 http 304 https://registry.npmjs.org/nan
113 silly registry.get cb [ 304,
113 silly registry.get   { date: 'Sun, 29 Dec 2013 07:14:20 GMT',
113 silly registry.get     server: 'Apache',
113 silly registry.get     connection: 'Keep-Alive',
113 silly registry.get     'keep-alive': 'timeout=10, max=50',
113 silly registry.get     etag: '"EVE9FQOY8QOVPL39YRIEVNB6R"',
113 silly registry.get     vary: 'Accept' } ]
114 verbose etag nan from cache
115 silly addNameRange number 2 { name: 'nan', range: '>=0.4.1-0 <0.5.0-0', hasData: true }
116 silly addNameRange versions [ 'nan',
116 silly addNameRange   [ '0.3.0-wip',
116 silly addNameRange     '0.3.0-wip2',
116 silly addNameRange     '0.3.0',
116 silly addNameRange     '0.3.1',
116 silly addNameRange     '0.3.2',
116 silly addNameRange     '0.4.0',
116 silly addNameRange     '0.4.1',
116 silly addNameRange     '0.4.2',
116 silly addNameRange     '0.4.3',
116 silly addNameRange     '0.4.4',
116 silly addNameRange     '0.5.0',
116 silly addNameRange     '0.5.1',
116 silly addNameRange     '0.5.2',
116 silly addNameRange     '0.6.0',
116 silly addNameRange     '0.7.0' ] ]
117 verbose addNamed [ 'nan', '0.4.4' ]
118 verbose addNamed [ '0.4.4', '0.4.4' ]
119 silly lockFile 795fb663-nan-0-4-4 nan@0.4.4
120 verbose lock nan@0.4.4 /Volumes/User/Home/.npm/795fb663-nan-0-4-4.lock
121 silly lockFile 795fb663-nan-0-4-4 nan@0.4.4
122 silly lockFile 795fb663-nan-0-4-4 nan@0.4.4
123 silly lockFile d65817a5-nan-0-4-1 nan@~0.4.1
124 silly lockFile d65817a5-nan-0-4-1 nan@~0.4.1
125 silly resolved [ { name: 'nan',
125 silly resolved     version: '0.4.4',
125 silly resolved     description: 'Native Abstractions for Node.js: C++ header for Node 0.8->0.12 compatibility',
125 silly resolved     main: '.index.js',
125 silly resolved     repository: { type: 'git', url: 'git://github.com/rvagg/nan.git' },
125 silly resolved     contributors: [ [Object], [Object], [Object] ],
125 silly resolved     license: 'MIT',
125 silly resolved     readme: 'Native Abstractions for Node.js\n===============================\n\n**A header file filled with macro and utility goodness for making add-on development for Node.js easier across versions 0.8, 0.10 and 0.11, and eventually 0.12.**\n\n***Current version: 0.4.4*** *(See [nan.h](https://github.com/rvagg/nan/blob/master/nan.h) for complete ChangeLog)*\n\n[![NPM](https://nodei.co/npm/nan.png?downloads=true&stars=true)](https://nodei.co/npm/nan/) [![NPM](https://nodei.co/npm-dl/nan.png?months=6)](https://nodei.co/npm/nan/)\n\nThanks to the crazy changes in V8 (and some in Node core), keeping native addons compiling happily across versions, particularly 0.10 to 0.11/0.12, is a minor nightmare. The goal of this project is to store all logic necessary to develop native Node.js addons without having to inspect `NODE_MODULE_VERSION` and get yourself into a macro-tangle.\n\nThis project also contains some helper utilities that make addon development a bit more pleasant.\n\n * **[Usage](#usage)**\n * **[Example](#example)**\n * **[API](#api)**\n\n<a name="usage"></a>\n## Usage\n\nSimply add **NAN** as a dependency in the *package.json* of your Node addon:\n\n```js\n"dependencies": {\n    ...\n    "nan" : "~0.4.4"\n    ...\n}\n```\n\nPull in the path to **NAN** in your *binding.gyp* so that you can use `#include "nan.h"` in your *.cpp*:\n\n```js\n"include_dirs" : [\n    "<!(node -p -e \\"require(\'path\').relative(\'.\', require(\'path\').dirname(require.resolve(\'nan\')))\\")"\n]\n```\n\nThis works like a `-I<path-to-NAN>` when compiling your addon.\n\n<a name="example"></a>\n## Example\n\nSee **[LevelDOWN](https://github.com/rvagg/node-leveldown/pull/48)** for a full example of **NAN** in use.\n\nFor a simpler example, see the **[async pi estimation example](https://github.com/rvagg/nan/tree/master/examples/async_pi_estimate)** in the examples directory for full code and an explanation of what this Monte Carlo Pi estimation example does. Below are just some parts of the full example that illustrate the use of **NAN**.\n\nCompare to the current 0.10 version of this example, found in the [node-addon-examples](https://github.com/rvagg/node-addon-examples/tree/master/9_async_work) repository and also a 0.11 version of the same found [here](https://github.com/kkoopa/node-addon-examples/tree/5c01f58fc993377a567812597e54a83af69686d7/9_async_work).\n\nNote that there is no embedded version sniffing going on here and also the async work is made much simpler, see below for details on the `NanAsyncWorker` class.\n\n```c++\n// addon.cc\n#include <node.h>\n#include "nan.h"\n// ...\n\nusing namespace v8;\n\nvoid InitAll(Handle<Object> exports) {\n  exports->Set(NanSymbol("calculateSync"),\n    FunctionTemplate::New(CalculateSync)->GetFunction());\n\n  exports->Set(NanSymbol("calculateAsync"),\n    FunctionTemplate::New(CalculateAsync)->GetFunction());\n}\n\nNODE_MODULE(addon, InitAll)\n```\n\n```c++\n// sync.h\n#include <node.h>\n#include "nan.h"\n\nNAN_METHOD(CalculateSync);\n```\n\n```c++\n// sync.cc\n#include <node.h>\n#include "nan.h"\n#include "sync.h"\n// ...\n\nusing namespace v8;\n\n// Simple synchronous access to the `Estimate()` function\nNAN_METHOD(CalculateSync) {\n  NanScope();\n\n  // expect a number as the first argument\n  int points = args[0]->Uint32Value();\n  double est = Estimate(points);\n\n  NanReturnValue(Number::New(est));\n}\n```\n\n```c++\n// async.cc\n#include <node.h>\n#include "nan.h"\n#include "async.h"\n\n// ...\n\nusing namespace v8;\n\nclass PiWorker : public NanAsyncWorker {\n public:\n  PiWorker(NanCallback *callback, int points)\n    : NanAsyncWorker(callback), points(points) {}\n  ~PiWorker() {}\n\n  // Executed inside the worker-thread.\n  // It is not safe to access V8, or V8 data structures\n  // here, so everything we need for input and output\n  // should go on `this`.\n  void Execute () {\n    estimate = Estimate(points);\n  }\n\n  // Executed when the async work is complete\n  // this function will be run inside the main event loop\n  // so it is safe to use V8 again\n  void HandleOKCallback () {\n    NanScope();\n\n    Local<Value> argv[] = {\n        Local<Value>::New(Null())\n      , Number::New(estimate)\n    };\n\n    callback->Call(2, argv);\n  };\n\n private:\n  int points;\n  double estimate;\n};\n\n// Asynchronous access to the `Estimate()` function\nNAN_METHOD(CalculateAsync) {\n  NanScope();\n\n  int points = args[0]->Uint32Value();\n  NanCallback *callback = new NanCallback(args[1].As<Function>());\n\n  NanAsyncQueueWorker(new PiWorker(callback, points));\n  NanReturnUndefined();\n}\n```\n\n<a name="api"></a>\n## API\n\n * <a href="#api_nan_method"><b><code>NAN_METHOD</code></b></a>\n * <a href="#api_nan_getter"><b><code>NAN_GETTER</code></b></a>\n * <a href="#api_nan_setter"><b><code>NAN_SETTER</code></b></a>\n * <a href="#api_nan_property_getter"><b><code>NAN_PROPERTY_GETTER</code></b></a>\n * <a href="#api_nan_property_setter"><b><code>NAN_PROPERTY_SETTER</code></b></a>\n * <a href="#api_nan_property_enumerator"><b><code>NAN_PROPERTY_ENUMERATOR</code></b></a>\n * <a href="#api_nan_property_deleter"><b><code>NAN_PROPERTY_DELETER</code></b></a>\n * <a href="#api_nan_property_query"><b><code>NAN_PROPERTY_QUERY</code></b></a>\n * <a href="#api_nan_weak_callback"><b><code>NAN_WEAK_CALLBACK</code></b></a>\n * <a href="#api_nan_deprecated"><b><code>NAN_DEPRECATED</code></b></a>\n * <a href="#api_nan_inline"><b><code>NAN_INLINE</code></b></a> \n * <a href="#api_nan_return_value"><b><code>NanReturnValue</code></b></a>\n * <a href="#api_nan_return_undefined"><b><code>NanReturnUndefined</code></b></a>\n * <a href="#api_nan_return_null"><b><code>NanReturnNull</code></b></a>\n * <a href="#api_nan_return_empty_string"><b><code>NanReturnEmptyString</code></b></a>\n * <a href="#api_nan_scope"><b><code>NanScope</code></b></a>\n * <a href="#api_nan_locker"><b><code>NanLocker</code></b></a>\n * <a href="#api_nan_unlocker"><b><code>NanUnlocker</code></b></a>\n * <a href="#api_nan_get_internal_field_pointer"><b><code>NanGetInternalFieldPointer</code></b></a>\n * <a href="#api_nan_set_internal_field_pointer"><b><code>NanSetInternalFieldPointer</code></b></a>\n * <a href="#api_nan_object_wrap_handle"><b><code>NanObjectWrapHandle</code></b></a>\n * <a href="#api_nan_make_weak"><b><code>NanMakeWeak</code></b></a>\n * <a href="#api_nan_symbol"><b><code>NanSymbol</code></b></a>\n * <a href="#api_nan_get_pointer_safe"><b><code>NanGetPointerSafe</code></b></a>\n * <a href="#api_nan_set_pointer_safe"><b><code>NanSetPointerSafe</code></b></a>\n * <a href="#api_nan_from_v8_string"><b><code>NanFromV8String</code></b></a>\n * <a href="#api_nan_boolean_option_value"><b><code>NanBooleanOptionValue</code></b></a>\n * <a href="#api_nan_uint32_option_value"><b><code>NanUInt32OptionValue</code></b></a>\n * <a href="#api_nan_error"><b><code>NanError</code></b>, <b><code>NanTypeError</code></b>, <b><code>NanRangeError</code></b></a>\n * <a href="#api_nan_throw_error"><b><code>NanThrowError</code></b>, <b><code>NanThrowTypeError</code></b>, <b><code>NanThrowRangeError</code></b>, <b><code>NanThrowError(Handle<Value>)</code></b>, <b><code>NanThrowError(Handle<Value>, int)</code></b></a>\n * <a href="#api_nan_new_buffer_handle"><b><code>NanNewBufferHandle(char *, size_t, FreeCallback, void *)</code></b>, <b><code>NanNewBufferHandle(char *, uint32_t)</code></b>, <b><code>NanNewBufferHandle(uint32_t)</code></b></a>\n * <a href="#api_nan_buffer_use"><b><code>NanBufferUse(char *, uint32_t)</code></b></a>\n * <a href="#api_nan_new_context_handle"><b><code>NanNewContextHandle</code></b></a>\n * <a href="#api_nan_has_instance"><b><code>NanHasInstance</code></b></a>\n * <a href="#api_nan_persistent_to_local"><b><code>NanPersistentToLocal</code></b></a>\n * <a href="#api_nan_dispose"><b><code>NanDispose</code></b></a>\n * <a href="#api_nan_assign_persistent"><b><code>NanAssignPersistent</code></b></a>\n * <a href="#api_nan_init_persistent"><b><code>NanInitPersistent</code></b></a>\n * <a href="#api_nan_callback"><b><code>NanCallback</code></b></a>\n * <a href="#api_nan_async_worker"><b><code>NanAsyncWorker</code></b></a>\n * <a href="#api_nan_async_queue_worker"><b><code>NanAsyncQueueWorker</code></b></a>\n\n<a name="api_nan_method"></a>\n### NAN_METHOD(methodname)\n\nUse `NAN_METHOD` to define your V8 accessible methods:\n\n```c++\n// .h:\nclass Foo : public node::ObjectWrap {\n  ...\n\n  static NAN_METHOD(Bar);\n  static NAN_METHOD(Baz);\n}\n\n\n// .cc:\nNAN_METHOD(Foo::Bar) {\n  ...\n}\n\nNAN_METHOD(Foo::Baz) {\n  ...\n}\n```\n\nThe reason for this macro is because of the method signature change in 0.11:\n\n```c++\n// 0.10 and below:\nHandle<Value> name(const Arguments& args)\n\n// 0.11 and above\nvoid name(const FunctionCallbackInfo<Value>& args)\n```\n\nThe introduction of `FunctionCallbackInfo` brings additional complications:\n\n<a name="api_nan_getter"></a>\n### NAN_GETTER(methodname)\n\nUse `NAN_GETTER` to declare your V8 accessible getters. You get a `Local<String>` `property` and an appropriately typed `args` object that can act like the `args` argument to a `NAN_METHOD` call.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_GETTER`.\n\n<a name="api_nan_setter"></a>\n### NAN_SETTER(methodname)\n\nUse `NAN_SETTER` to declare your V8 accessible setters. Same as `NAN_GETTER` but you also get a `Local<Value>` `value` object to work with.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_SETTER`.\n\n<a name="api_nan_property_getter"></a>\n### NAN_PROPERTY_GETTER(cbname)\nUse `NAN_PROPERTY_GETTER` to declare your V8 accessible property getters. You get a `Local<String>` `property` and an appropriately typed `args` object that can act similar to the `args` argument to a `NAN_METHOD` call.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_GETTER`.\n\n<a name="api_nan_property_setter"></a>\n### NAN_PROPERTY_SETTER(cbname)\nUse `NAN_PROPERTY_SETTER` to declare your V8 accessible property setters. Same as `NAN_PROPERTY_GETTER` but you also get a `Local<Value>` `value` object to work with.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_SETTER`.\n\n<a name="api_nan_property_enumerator"></a>\n### NAN_PROPERTY_ENUMERATOR(cbname)\nUse `NAN_PROPERTY_ENUMERATOR` to declare your V8 accessible property enumerators. You get an appropriately typed `args` object like the `args` argument to a `NAN_PROPERTY_GETTER` call.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_ENUMERATOR`.\n\n<a name="api_nan_property_deleter"></a>\n### NAN_PROPERTY_DELETER(cbname)\nUse `NAN_PROPERTY_DELETER` to declare your V8 accessible property deleters. Same as `NAN_PROPERTY_GETTER`.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_DELETER`.\n\n<a name="api_nan_property_query"></a>\n### NAN_PROPERTY_QUERY(cbname)\nUse `NAN_PROPERTY_QUERY` to declare your V8 accessible property queries. Same as `NAN_PROPERTY_GETTER`.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_QUERY`.\n\n<a name="api_nan_weak_callback"></a>\n### NAN_WEAK_CALLBACK(type, cbname)\n\nUse `NAN_WEAK_CALLBACK` to declare your V8 WeakReference callbacks. There is an object argument accessible through `NAN_WEAK_CALLBACK_OBJECT`. The `type` argument gives the type of the `data` argument, accessible through `NAN_WEAK_CALLBACK_DATA(type)`.\n\n```c++\nstatic NAN_WEAK_CALLBACK(BufferReference*, WeakCheck) {\n  if (NAN_WEAK_CALLBACK_DATA(BufferReference*)->noLongerNeeded_) {\n    delete NAN_WEAK_CALLBACK_DATA(BufferReference*);\n  } else {\n    // Still in use, revive, prevent GC\n    NanMakeWeak(NAN_WEAK_CALLBACK_OBJECT, NAN_WEAK_CALLBACK_DATA(BufferReference*), &WeakCheck);\n  }\n}\n```\n\n<a name="api_nan_deprecated"></a>\n### NAN_DEPRECATED(declarator)\nDeclares a function as deprecated. Identical to `V8_DEPRECATED`.\n\n```c++\nstatic NAN_DEPRECATED(NAN_METHOD(foo)) {\n  ...\n}\n```\n\n<a name="api_nan_inline"></a>\n### NAN_INLINE(declarator)\nInlines a function. Identical to `V8_INLINE`.\n\n```c++\nstatic NAN_INLINE(int foo(int bar)) {\n  ...\n}\n```\n\n<a name="api_nan_return_value"></a>\n### NanReturnValue(Handle&lt;Value&gt;)\n\nUse `NanReturnValue` when you want to return a value from your V8 accessible method:\n\n```c++\nNAN_METHOD(Foo::Bar) {\n  ...\n\n  NanReturnValue(String::New("FooBar!"));\n}\n```\n\nNo `return` statement required.\n\n<a name="api_nan_return_undefined"></a>\n### NanReturnUndefined()\n\nUse `NanReturnUndefined` when you don\'t want to return anything from your V8 accessible method:\n\n```c++\nNAN_METHOD(Foo::Baz) {\n  ...\n\n  NanReturnUndefined();\n}\n```\n\n<a name="api_nan_return_null"></a>\n### NanReturnNull()\n\nUse `NanReturnNull` when you want to return `Null` from your V8 accessible method:\n\n```c++\nNAN_METHOD(Foo::Baz) {\n  ...\n\n  NanReturnNull();\n}\n```\n\n<a name="api_nan_return_empty_string"></a>\n### NanReturnEmptyString()\n\nUse `NanReturnEmptyString` when you want to return an empty `String` from your V8 accessible method:\n\n```c++\nNAN_METHOD(Foo::Baz) {\n  ...\n\n  NanReturnEmptyString();\n}\n```\n\n<a name="api_nan_scope"></a>\n### NanScope()\n\nThe introduction of `isolate` references for many V8 calls in Node 0.11 makes `NanScope()` necessary, use it in place of `HandleScope scope`:\n\n```c++\nNAN_METHOD(Foo::Bar) {\n  NanScope();\n\n  NanReturnValue(String::New("FooBar!"));\n}\n```\n\n<a name="api_nan_locker"></a>\n### NanLocker()\n\nThe introduction of `isolate` references for many V8 calls in Node 0.11 makes `NanLocker()` necessary, use it in place of `Locker locker`:\n\n```c++\nNAN_METHOD(Foo::Bar) {\n  NanLocker();\n  ...\n  NanUnlocker();\n}\n```\n\n<a name="api_nan_unlocker"></a>\n### NanUnlocker()\n\nThe introduction of `isolate` references for many V8 calls in Node 0.11 makes `NanUnlocker()` necessary, use it in place of `Unlocker unlocker`:\n\n```c++\nNAN_METHOD(Foo::Bar) {\n  NanLocker();\n  ...\n  NanUnlocker();\n}\n```\n\n<a name="api_nan_get_internal_field_pointer"></a>\n### void * NanGetInternalFieldPointer(Handle&lt;Object&gt;, int)\n\nGets a pointer to the internal field with at `index` from a V8 `Object` handle.\n\n```c++\nLocal<Object> obj;\n...\nNanGetInternalFieldPointer(obj, 0);\n```\n<a name="api_nan_set_internal_field_pointer"></a>\n### void NanSetInternalFieldPointer(Handle&lt;Object&gt;, int, void *)\n\nSets the value of the internal field at `index` on a V8 `Object` handle.\n\n```c++\nstatic Persistent<Function> dataWrapperCtor;\n...\nLocal<Object> wrapper = NanPersistentToLocal(dataWrapperCtor)->NewInstance();\nNanSetInternalFieldPointer(wrapper, 0, this);\n```\n\n<a name="api_nan_object_wrap_handle"></a>\n### Local&lt;Object&gt; NanObjectWrapHandle(Object)\n\nWhen you want to fetch the V8 object handle from a native object you\'ve wrapped with Node\'s `ObjectWrap`, you should use `NanObjectWrapHandle`:\n\n```c++\nNanObjectWrapHandle(iterator)->Get(String::NewSymbol("end"))\n```\n\n<a name="api_nan_make_weak"></a>\n### NanMakeWeak(Persistent&lt;T&gt;, parameter, callback)\n\nMake a persistent reference weak.\n\n<a name="api_nan_symbol"></a>\n### String NanSymbol(char *)\n\nThis isn\'t strictly about compatibility, it\'s just an easier way to create string symbol objects (i.e. `String::NewSymbol(x)`), for getting and setting object properties, or names of objects.\n\n```c++\nbool foo = false;\nif (obj->Has(NanSymbol("foo")))\n  foo = optionsObj->Get(NanSymbol("foo"))->BooleanValue()\n```\n\n<a name="api_nan_get_pointer_safe"></a>\n### Type NanGetPointerSafe(Type *[, Type])\n\nA helper for getting values from optional pointers. If the pointer is `NULL`, the function returns the optional default value, which defaults to `0`.  Otherwise, the function returns the value the pointer points to.\n\n```c++\nchar *plugh(uint32_t *optional) {\n  char res[] = "xyzzy";\n  uint32_t param = NanGetPointerSafe<uint32_t>(optional, 0x1337);\n  switch (param) {\n    ...\n  }\n  NanSetPointerSafe<uint32_t>(optional, 0xDEADBEEF);\n}  \n```\n\n<a name="api_nan_set_pointer_safe"></a>\n### bool NanSetPointerSafe(Type *, Type)\n\nA helper for setting optional argument pointers. If the pointer is `NULL`, the function simply return `false`.  Otherwise, the value is assigned to the variable the pointer points to.\n\n```c++\nconst char *plugh(size_t *outputsize) {\n  char res[] = "xyzzy";\n  if !(NanSetPointerSafe<size_t>(outputsize, strlen(res) + 1)) {\n    ...\n  }\n\n  ...\n}\n```\n\n<a name="api_nan_from_v8_string"></a>\n### char* NanFromV8String(Handle&lt;Value&gt;[, enum Nan::Encoding, size_t *, char *, size_t, int])\n\nWhen you want to convert a V8 `String` to a `char*` use `NanFromV8String`. It is possible to define an encoding that defaults to `Nan::UTF8` as well as a pointer to a variable that will be assigned the number of bytes in the returned string. It is also possible to supply a buffer and its length to the function in order not to have a new buffer allocated. The final argument allows optionally setting `String::WriteOptions`, which default to `String::HINT_MANY_WRITES_EXPECTED | String::NO_NULL_TERMINATION`.\nJust remember that you\'ll end up with an object that you\'ll need to `delete[]` at some point unless you supply your own buffer:\n\n```c++\nsize_t count;\nchar* name = NanFromV8String(args[0]);\nchar* decoded = NanFromV8String(args[1], Nan::BASE64, &count, NULL, 0, String::HINT_MANY_WRITES_EXPECTED);\nchar param_copy[count];\nmemcpy(param_copy, decoded, count);\ndelete[] decoded;\n```\n\n<a name="api_nan_boolean_option_value"></a>\n### bool NanBooleanOptionValue(Handle&lt;Value&gt;, Handle&lt;String&gt;[, bool])\n\nWhen you have an "options" object that you need to fetch properties from, boolean options can be fetched with this pair. They check first if the object exists (`IsEmpty`), then if the object has the given property (`Has`) then they get and convert/coerce the property to a `bool`.\n\nThe optional last parameter is the *default* value, which is `false` if left off:\n\n```c++\n// `foo` is false unless the user supplies a truthy value for it\nbool foo = NanBooleanOptionValue(optionsObj, NanSymbol("foo"));\n// `bar` is true unless the user supplies a falsy value for it\nbool bar = NanBooleanOptionValueDefTrue(optionsObj, NanSymbol("bar"), true);\n```\n\n<a name="api_nan_uint32_option_value"></a>\n### uint32_t NanUInt32OptionValue(Handle&lt;Value&gt;, Handle&lt;String&gt;, uint32_t)\n\nSimilar to `NanBooleanOptionValue`, use `NanUInt32OptionValue` to fetch an integer option from your options object. Can be any kind of JavaScript `Number` and it will be coerced to an unsigned 32-bit integer.\n\nRequires all 3 arguments as a default is not optional:\n\n```c++\nuint32_t count = NanUInt32OptionValue(optionsObj, NanSymbol("count"), 1024);\n```\n\n<a name="api_nan_error"></a>\n### NanError(message), NanTypeError(message), NanRangeError(message)\n\nFor making `Error`, `TypeError` and `RangeError` objects.\n\n```c++\nLocal<Value> res = NanError("you must supply a callback argument");\n```\n\n<a name="api_nan_throw_error"></a>\n### NanThrowError(message), NanThrowTypeError(message), NanThrowRangeError(message), NanThrowError(Local&lt;Value&gt;), NanThrowError(Local&lt;Value&gt;, int)\n\nFor throwing `Error`, `TypeError` and `RangeError` objects. You should `return` this call:\n\n```c++\nreturn NanThrowError("you must supply a callback argument");\n```\n\nCan also handle any custom object you may want to throw. If used with the error code argument, it will add the supplied error code to the error object as a property called `code`.\n\n<a name="api_nan_new_buffer_handle"></a>\n### Local&lt;Object&gt; NanNewBufferHandle(char *, uint32_t), Local&lt;Object&gt; NanNewBufferHandle(uint32_t)\n\nThe `Buffer` API has changed a little in Node 0.11, this helper provides consistent access to `Buffer` creation:\n\n```c++\nNanNewBufferHandle((char*)value.data(), value.size());\n```\n\nCan also be used to initialize a `Buffer` with just a `size` argument.\n\nCan also be supplied with a `NAN_WEAK_CALLBACK` and a hint for the garbage collector, when dealing with weak references.\n\n<a name="api_nan_buffer_use"></a>\n### Local&lt;Object&gt; NanBufferUse(char*, uint32_t)\n\n`Buffer::New(char*, uint32_t)` prior to 0.11 would make a copy of the data.\nWhile it was possible to get around this, it required a shim by passing a\ncallback. So the new API `Buffer::Use(char*, uint32_t)` was introduced to remove\nneeding to use this shim.\n\n`NanBufferUse` uses the `char*` passed as the backing data, and will free the\nmemory automatically when the weak callback is called. Keep this in mind, as\ncareless use can lead to "double free or corruption" and other cryptic failures.\n\n<a name="api_nan_has_instance"></a>\n### bool NanHasInstance(Persistent&lt;FunctionTemplate&gt;&, Handle&lt;Value&gt;)\n\nCan be used to check the type of an object to determine it is of a particular class you have already defined and have a `Persistent<FunctionTemplate>` handle for.\n\n<a name="api_nan_persistent_to_local"></a>\n### Local&lt;Type&gt; NanPersistentToLocal(Persistent&lt;Type&gt;&)\n\nAside from `FunctionCallbackInfo`, the biggest and most painful change to V8 in Node 0.11 is the many restrictions now placed on `Persistent` handles. They are difficult to assign and difficult to fetch the original value out of.\n\nUse `NanPersistentToLocal` to convert a `Persistent` handle back to a `Local` handle.\n\n```c++\nLocal<Object> handle = NanPersistentToLocal(persistentHandle);\n```\n\n<a href="#api_nan_new_context_handle">\n### Local&lt;Context&gt; NanNewContextHandle([ExtensionConfiguration*, Handle&lt;ObjectTemplate&gt;, Handle&lt;Value&gt;])\nCreates a new `Local<Context>` handle.\n\n```c++\nLocal<FunctionTemplate> ftmpl = FunctionTemplate::New();\nLocal<ObjectTemplate> otmpl = ftmpl->InstanceTemplate();\nLocal<Context> ctx =  NanNewContextHandle(NULL, otmpl);\n```\n\n<a name="api_nan_dispose"></a>\n### void NanDispose(Persistent&lt;T&gt; &)\n\nUse `NanDispose` to dispose a `Persistent` handle.\n\n```c++\nNanDispose(persistentHandle);\n```\n\n<a name="api_nan_assign_persistent"></a>\n### NanAssignPersistent(type, handle, object)\n\nUse `NanAssignPersistent` to assign a non-`Persistent` handle to a `Persistent` one. You can no longer just declare a `Persistent` handle and assign directly to it later, you have to `Reset` it in Node 0.11, so this makes it easier.\n\nIn general it is now better to place anything you want to protect from V8\'s garbage collector as properties of a generic `Object` and then assign that to a `Persistent`. This works in older versions of Node also if you use `NanAssignPersistent`:\n\n```c++\nPersistent<Object> persistentHandle;\n\n...\n\nLocal<Object> obj = Object::New();\nobj->Set(NanSymbol("key"), keyHandle); // where keyHandle might be a Local<String>\nNanAssignPersistent(Object, persistentHandle, obj)\n```\n\n<a name="api_nan_init_persistent"></a>\n### NanInitPersistent(type, name, object)\n\nUser `NanInitPersistent` to declare and initialize a new `Persistent` with the supplied object. The assignment operator for `Persistent` is no longer public in Node 0.11, so this macro makes it easier to declare and initializing a new `Persistent`. See <a href="#api_nan_assign_persistent"><b><code>NanAssignPersistent</code></b></a> for more information.\n\n```c++\nLocal<Object> obj = Object::New();\nobj->Set(NanSymbol("key"), keyHandle); // where keyHandle might be a Local<String>\nNanInitPersistent(Object, persistentHandle, obj);\n```\n\n<a name="api_nan_callback"></a>\n### NanCallback\n\nBecause of the difficulties imposed by the changes to `Persistent` handles in V8 in Node 0.11, creating `Persistent` versions of your `Local<Function>` handles is annoyingly tricky. `NanCallback` makes it easier by taking your `Local` handle, making it persistent until the `NanCallback` is deleted and even providing a handy `Call()` method to fetch and execute the callback `Function`.\n\n```c++\nLocal<Function> callbackHandle = callback = args[0].As<Function>();\nNanCallback *callback = new NanCallback(callbackHandle);\n// pass `callback` around and it\'s safe from GC until you:\ndelete callback;\n```\n\nYou can execute the callback like so:\n\n```c++\n// no arguments:\ncallback->Call(0, NULL);\n\n// an error argument:\nLocal<Value> argv[] = {\n  Exception::Error(String::New("fail!"))\n};\ncallback->Call(1, argv);\n\n// a success argument:\nLocal<Value> argv[] = {\n  Local<Value>::New(Null()),\n  String::New("w00t!")\n};\ncallback->Call(2, argv);\n```\n\n`NanCallback` also has a `Local<Function> GetCallback()` method that you can use to fetch a local handle to the underlying callback function if you need it.\n\n<a name="api_nan_async_worker"></a>\n### NanAsyncWorker\n\n`NanAsyncWorker` is an abstract class that you can subclass to have much of the annoying async queuing and handling taken care of for you. It can even store arbitrary V8 objects for you and have them persist while the async work is in progress.\n\nSee a rough outline of the implementation:\n\n```c++\nclass NanAsyncWorker {\npublic:\n  NanAsyncWorker (NanCallback *callback);\n\n  // Clean up persistent handles and delete the *callback\n  virtual ~NanAsyncWorker ();\n\n  // Check the `char *errmsg` property and call HandleOKCallback()\n  // or HandleErrorCallback depending on whether it has been set or not\n  virtual void WorkComplete ();\n\n  // You must implement this to do some async work. If there is an\n  // error then allocate `errmsg` to to a message and the callback will\n  // be passed that string in an Error object\n  virtual void Execute ();\n\nprotected:\n  // Set this if there is an error, otherwise it\'s NULL\n  const char *errmsg;\n\n  // Save a V8 object in a Persistent handle to protect it from GC\n  void SavePersistent(const char *key, Local<Object> &obj);\n\n  // Fetch a stored V8 object (don\'t call from within `Execute()`)\n  Local<Object> GetFromPersistent(const char *key);\n\n  // Default implementation calls the callback function with no arguments.\n  // Override this to return meaningful data\n  virtual void HandleOKCallback ();\n\n  // Default implementation calls the callback function with an Error object\n  // wrapping the `errmsg` string\n  virtual void HandleErrorCallback ();\n};\n```\n\n<a name="api_nan_async_queue_worker"></a>\n### NanAsyncQueueWorker(NanAsyncWorker *)\n\n`NanAsyncQueueWorker` will run a `NanAsyncWorker` asynchronously via libuv. Both the *execute* and *after_work* steps are taken care of for you&mdash;most of the logic for this is embedded in `NanAsyncWorker`.\n\n### Contributors\n\nNAN is only possible due to the excellent work of the following contributors:\n\n<table><tbody>\n<tr><th align="left">Rod Vagg</th><td><a href="https://github.com/rvagg">GitHub/rvagg</a></td><td><a href="http://twitter.com/rvagg">Twitter/@rvagg</a></td></tr>\n<tr><th align="left">Benjamin Byholm</th><td><a href="https://github.com/kkoopa/">GitHub/kkoopa</a></td></tr>\n<tr><th align="left">Trevor Norris</th><td><a href="https://github.com/trevnorris">GitHub/trevnorris</a></td><td><a href="http://twitter.com/trevnorris">Twitter/@trevnorris</a></td></tr>\n</tbody></table>\n\nLicence &amp; copyright\n-----------------------\n\nCopyright (c) 2013 NAN contributors (listed above).\n\nNative Abstractions for Node.js is licensed under an MIT +no-false-attribs license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.\n',
125 silly resolved     readmeFilename: 'README.md',
125 silly resolved     bugs: { url: 'https://github.com/rvagg/nan/issues' },
125 silly resolved     homepage: 'https://github.com/rvagg/nan',
125 silly resolved     _id: 'nan@0.4.4',
125 silly resolved     _from: 'nan@~0.4.1' } ]
126 info install nan@0.4.4 into /Volumes/User/Home/Desktop/node_modules/canvas
127 info installOne nan@0.4.4
128 info /Volumes/User/Home/Desktop/node_modules/canvas/node_modules/nan unbuild
129 verbose tar unpack /Volumes/User/Home/.npm/nan/0.4.4/package.tgz
130 silly lockFile eae54d70--modules-canvas-node-modules-nan tar:///Volumes/User/Home/Desktop/node_modules/canvas/node_modules/nan
131 verbose lock tar:///Volumes/User/Home/Desktop/node_modules/canvas/node_modules/nan /Volumes/User/Home/.npm/eae54d70--modules-canvas-node-modules-nan.lock
132 silly lockFile 5e0ba34b-r-Home-npm-nan-0-4-4-package-tgz tar:///Volumes/User/Home/.npm/nan/0.4.4/package.tgz
133 verbose lock tar:///Volumes/User/Home/.npm/nan/0.4.4/package.tgz /Volumes/User/Home/.npm/5e0ba34b-r-Home-npm-nan-0-4-4-package-tgz.lock
134 silly gunzTarPerm modes [ '755', '644' ]
135 silly gunzTarPerm extractEntry package.json
136 silly gunzTarPerm extractEntry README.md
137 silly gunzTarPerm extractEntry LICENSE
138 silly gunzTarPerm extractEntry .index.js
139 silly gunzTarPerm extractEntry nan.h
140 silly lockFile eae54d70--modules-canvas-node-modules-nan tar:///Volumes/User/Home/Desktop/node_modules/canvas/node_modules/nan
141 silly lockFile eae54d70--modules-canvas-node-modules-nan tar:///Volumes/User/Home/Desktop/node_modules/canvas/node_modules/nan
142 silly lockFile 5e0ba34b-r-Home-npm-nan-0-4-4-package-tgz tar:///Volumes/User/Home/.npm/nan/0.4.4/package.tgz
143 silly lockFile 5e0ba34b-r-Home-npm-nan-0-4-4-package-tgz tar:///Volumes/User/Home/.npm/nan/0.4.4/package.tgz
144 info preinstall nan@0.4.4
145 verbose readDependencies using package.json deps
146 verbose readDependencies using package.json deps
147 silly resolved []
148 verbose about to build /Volumes/User/Home/Desktop/node_modules/canvas/node_modules/nan
149 info build /Volumes/User/Home/Desktop/node_modules/canvas/node_modules/nan
150 verbose linkStuff [ false,
150 verbose linkStuff   false,
150 verbose linkStuff   false,
150 verbose linkStuff   '/Volumes/User/Home/Desktop/node_modules/canvas/node_modules' ]
151 info linkStuff nan@0.4.4
152 verbose linkBins nan@0.4.4
153 verbose linkMans nan@0.4.4
154 verbose rebuildBundles nan@0.4.4
155 info install nan@0.4.4
156 info postinstall nan@0.4.4
157 verbose about to build /Volumes/User/Home/Desktop/node_modules/canvas
158 info build /Volumes/User/Home/Desktop/node_modules/canvas
159 verbose linkStuff [ false, false, false, '/Volumes/User/Home/Desktop/node_modules' ]
160 info linkStuff canvas@1.1.2
161 verbose linkBins canvas@1.1.2
162 verbose linkMans canvas@1.1.2
163 verbose rebuildBundles canvas@1.1.2
164 verbose rebuildBundles [ 'nan' ]
165 info install canvas@1.1.2
166 verbose unsafe-perm in lifecycle true
167 info canvas@1.1.2 Failed to exec install script
168 info /Volumes/User/Home/Desktop/node_modules/canvas unbuild
169 info preuninstall canvas@1.1.2
170 info uninstall canvas@1.1.2
171 verbose true,/Volumes/User/Home/Desktop/node_modules,/Volumes/User/Home/Desktop/node_modules unbuild canvas@1.1.2
172 info postuninstall canvas@1.1.2
173 error canvas@1.1.2 install: `node-gyp rebuild`
173 error Exit status 1
174 error Failed at the canvas@1.1.2 install script.
174 error This is most likely a problem with the canvas package,
174 error not with npm itself.
174 error Tell the author that this fails on your system:
174 error     node-gyp rebuild
174 error You can get their info via:
174 error     npm owner ls canvas
174 error There is likely additional logging output above.
175 error System Darwin 13.0.0
176 error command "/usr/local/Cellar/node/0.10.24/bin/node" "/usr/local/bin/npm" "install" "canvas"
177 error cwd /Volumes/User/Home/Desktop
178 error node -v v0.10.24
179 error npm -v 1.3.21
180 error code ELIFECYCLE
181 verbose exit [ 1, true ]
elgs commented 10 years ago

Solved the problem by brew install cairo --without-x