您好,我正在尝试使一些 Javascript 文件在 nodeJS 上运行,一切都设置得很好,但是这是我得到的错误:
C:\>node myServer.js
C:\myFunctionsCallTest.js:750
if( (j_lm && (navigator.appName == "Microsoft Internet Explorer")) || navigato
^
ReferenceError: navigator is not defined
at Object.<anonymous> (C:\myFunctionsCallTest.js:750:15)
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> (C:\myServer.js:1:79)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
C:\>
我正在使用的文件是:
myServer.js
var my_module = require("./myFunctionsCallTest.js");
console.log("RSA encrypted message :"+ my_module.Encrypt("myKey","myMessage"));
myFunctionsCallTest.js //This file contains some call of prototypes like :
.....................................
RSAKey.prototype.setPublic = RSASetPublic;
RSAKey.prototype._short_encrypt = RSAEncrypt;
RSAKey.prototype.encrypt = RSAEncryptLong;
RSAKey.prototype.encrypt_b64 = RSAEncryptB64;
..............................................
这个问题可能来自哪里的任何想法?谢谢。