browserify / wzrd.in

browserify as a service.
http://wzrd.in
MIT License
639 stars 96 forks source link

Error: "browserify exited with code 1" #90

Closed hemanth closed 10 years ago

hemanth commented 10 years ago

Was trying a simple canvas example like:

var Canvas = require('canvas')
  , Image = Canvas.Image
  , canvas = new Canvas(200,200)
  , ctx = canvas.getContext('2d');

ctx.font = '30px Impact';
ctx.rotate(.1);
ctx.fillText("Awesome!", 50, 100);

var te = ctx.measureText('Awesome!');
ctx.strokeStyle = 'rgba(0,0,0,0.5)';
ctx.beginPath();
ctx.lineTo(50, 102);
ctx.lineTo(50 + te.width, 102);
ctx.stroke();

console.log('<img src="' + canvas.toDataURL() + '" />');
Bundling error: 

---FLAGRANT SYSTEM ERROR---

--- error #0: ---

(logs uuid: 21d69340-4d15-11e4-8a94-67d101e3f163 )

Error: "browserify exited with code 1"

code: 1
stderr: Error: Cannot find module '../build/Release/canvas' from '/tmp/canvas11496-3287-uorszg/node_modules/canvas/lib'
    at /home/admin/browserify-cdn/node_modules/browserify/node_modules/resolve/lib/async.js:42:25
    at load (/home/admin/browserify-cdn/node_modules/browserify/node_modules/resolve/lib/async.js:60:43)
    at /home/admin/browserify-cdn/node_modules/browserify/node_modules/resolve/lib/async.js:66:22
    at /home/admin/browserify-cdn/node_modules/browserify/node_modules/resolve/lib/async.js:21:47
    at Object.oncomplete (fs.js:107:15)

dirPath: /tmp/canvas11496-3287-uorszg

------
jfhbrook commented 10 years ago

Browserify attempted to use native node-canvas, which failed because we removed the build tooling from the box. It doesn't really make sense on the browser, anyway.

Chances are, there's a readme/howto somewhere for being able to use the require("canvas") workflow as a shim for native canvas, but I don't know it off the top of my head.

hemanth commented 10 years ago

Ah, okies, will look for it. Thanks.