nayrnet / node-hikvision-api

NodeJS Module for Hikvision IPC HTTP API
GNU General Public License v3.0
191 stars 65 forks source link

Reference Error: self is not defined #7

Closed jjspierx closed 6 years ago

jjspierx commented 6 years ago

I am running into a reference error "self is not defined" error anytime the code tries to access the properties of "self". What is "self" exactly? I thought self was only used in Javascript where the client is a browser, and self refers to the window. In a Node.js app I am not sure what "self" is. I tried replacing self with "this", but "this" does not have the properties that "self" has.

I am using the latest code from here, not the NPM package.

ReferenceError: self is not defined hikvision.js:70 at c:\Users\jjspierx\Desktop\hikalert\node_modules\node-hikvision-api\hikvision.js:70:6 at Parser.<anonymous> (c:\Users\jjspierx\Desktop\hikalert\node_modules\xml2js\lib\parser.js:303:18) at emitOne (events.js:116:13) at Parser.emit (events.js:211:7) at SAXParser.onclosetag (c:\Users\jjspierx\Desktop\hikalert\node_modules\xml2js\lib\parser.js:261:26) at emit (c:\Users\jjspierx\Desktop\hikalert\node_modules\sax\lib\sax.js:624:35) at emitNode (c:\Users\jjspierx\Desktop\hikalert\node_modules\sax\lib\sax.js:629:5) at closeTag (c:\Users\jjspierx\Desktop\hikalert\node_modules\sax\lib\sax.js:889:7) at SAXParser.write (c:\Users\jjspierx\Desktop\hikalert\node_modules\sax\lib\sax.js:1436:13) at Parser.exports.Parser.Parser.parseString (c:\Users\jjspierx\Desktop\hikalert\node_modules\xml2js\lib\parser.js:322:31)

jjspierx commented 6 years ago

Nevermind, I was somehow using an old version and I also realized there was already an issue for this.

Duplicate of #2