png-js:不能读取属性'8'的undefined

每当我尝试在Node.js中使用png-js,我都会得到这个奇怪的错误:

/home/anderson/node_modules/png-js/png-node.js:152 b1 = this.data[this.pos++] << 24; ^ TypeError: Cannot read property '8' of undefined at PNG.readUInt32 (/home/anderson/node_modules/png-js/png-node.js:152:21) at new PNG (/home/anderson/node_modules/png-js/png-node.js:56:26) at /home/anderson/node_modules/png-js/png-node.js:34:15 at [object Object].<anonymous> (fs.js:88:5) at [object Object].emit (events.js:67:17) at Object.oncomplete (fs.js:1059:12) 

这是产生这个输出的程序:

 var PNG = require('png-js'); PNG.decode('some.png', function(pixels) { // pixels is a 1d array of decoded pixel data }); 

在过去,我已经能够毫无困难地使用png-js模块了。 这个模块可能与我安装的另一个node.js模块冲突吗?

在这种情况下,会出现错误消息,因为名为some.png的文件不在与node.js脚本相同的文件夹中。