jhiesey / videostream

Play html5 video when from a file-like object
MIT License
247 stars 73 forks source link

Object prototype may only be an Object or null #23

Closed alxhotel closed 8 years ago

alxhotel commented 8 years ago

It breaks just doing a require

var videostream = require('videostream')

Trace:

util.js:555
  ctor.prototype = Object.create(superCtor.prototype, {
                          ^
TypeError: Object prototype may only be an Object or null
    at Function.create (native)
    at exports.inherits (util.js:555:27)
    at Object.<anonymous> (/fakepath/webtorrent-test/node_modules/videostream/mp4-remuxer.js:20:1)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/fakepath/webtorrent-test/node_modules/videostream/videostream.js:6:18)

Any ideas ?

feross commented 8 years ago

This error looks like you're using an old version of node.js, probably 0.10. Try upgrading to at least v4. You can do that here: https://nodejs.org/en/

It fails because the code contains:

var EventEmitter = require('events')

But this used to be required in old node.js:

var EventEmitter = require('events').EventEmitter

Also, a more important issue to keep in mind: this package doesn't work in node.js. It's meant for the browser.

alxhotel commented 8 years ago

Oh yeah, that was the problem. Thanks.