trivial node require throwing error

Status
Not open for further replies.

cyrus

Ars Scholae Palatinae
724
Subscriptor++
I'm just getting into node. I've found a dependency injection library I like called electrolyte (https://github.com/jaredhanson/electrolyte), but the most trivial require script is throwing an error. My newness to node, the triviality of my test, and the absence of issues the library's git page makes me suspect I'm doing something wrong. I've done this in two environments (node on ubuntu from packages, node on mac from brew) with the same results.

install library:
Code:
npm install electrolyte

test.js:
Code:
var di = require("electrolyte");

throws err:
Code:
util.js:555
  ctor.prototype = Object.create(superCtor.prototype, {
                          ^
TypeError: Object prototype may only be an Object or null
    at Function.create (native)
    at Object.exports.inherits (util.js:555:27)
    at Object.<anonymous> (/home/vagrant/tmp/node_modules/electrolyte/lib/container.js:42:6)
    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> (/home/vagrant/tmp/node_modules/electrolyte/lib/index.js:1:79)

Before I run off submitting git issues, I thought I'd get some feedback from you fine folk.
 

cyrus

Ars Scholae Palatinae
724
Subscriptor++
Versioning was the problem. I assumed that at least one of brew and ubuntu packages would deliver a sufficiently recent version of node. I was wrong.

Adding node's 5.x repo fixed it (https://nodejs.org/en/download/package- ... tributions):

Code:
curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
sudo apt-get install -y nodejs
 
Status
Not open for further replies.