琐碎要求抛出错误

时间:2016-02-05 01:18:02

标签: javascript node.js npm

我正在尝试使用popular依赖注入库electrolyte,但即使是需要它的简单脚本也会引发错误。我找不到任何与我的错误相关的讨论或issues,但由于我是节点的新手,我想在向作者提出申诉之前检查我是不是做了一些明显错误的事情。

安装电解液:

npm install electrolyte

使用node:

运行此1行应用test.js
var di = require("electrolyte");

收到此错误:

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)

我在两个环境(ubuntu中的节点,来自brew,mac)中尝试了相同的结果。我可以安装并要求其他库没有问题。节点和电解质的版本似乎是最新的。

1 个答案:

答案 0 :(得分:0)

看起来我通过brew和debian软件包获得的节点版本已经很老了。在installation guide添加节点自己的debian存储库之后纠正了问题。