jaredhanson / electrolyte

Elegant dependency injection for Node.js.
MIT License
564 stars 61 forks source link

Error on require #41

Open jpolack opened 8 years ago

jpolack commented 8 years ago

I have just been requireing electrolyte simple as: var IoC = require('electrolyte');

throws following error:

node test.js

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. (/Users/xxx/testproject/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. (/Users/xxx/testproject/node_modules/electrolyte/lib/index.js:1:79)

am i using it wrong or is there an unstable state online?

thanks

hoxxep commented 8 years ago

At first glance this looks like there's an issue with your npm install or Node install rather than electrolyte, as you're getting a TypeError inside util.inherits -- a native Node library -- for something that doesn't appear to be electrolyte's fault. Try removing your node_modules folder and re-installing electrolyte. In failing that, post your Node and NPM versions (node -v and npm -v) and we'll go from there?

jpolack commented 8 years ago

Thanks guys,

i don't know how and why but i still had a node version of 0.10.13. So i got the 4.4.0 and i worked!

Thanks!