好吧这样的gose我有这个代码:
var PMP_Abstract = new JS.Class({});
var PMP = new JS.Singleton(PMP_Abstract,{
//on Application Start
initialize: function() {
}
});
总之,我想把主要逻辑但......这只是定义,
现在我有这个错误:
[Mon, 26 Mar 2012 08:09:01 GMT] INFO Creating 1 worker process.
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: undefined is not a function
at Object.<anonymous> (/Users/sivan/appTest/Testing/lib/PMP.js:1:82)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:31)
at Function._load (module.js:308:12)
at Module.require (module.js:354:17)
at require (module.js:370:17)
at Object.<anonymous> (/Users/sivan/appTest/Testing/app/controllers/main.js:20:1)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
[Mon, 26 Mar 2012 08:09:01 GMT] ERROR Worker 4442 died.
现在我该如何解决这个问题? 比如不知道这个功能在说什么...
答案 0 :(得分:0)
您正在使用JS.Class而未引用它。
在您的控制台中输入npm install jsclass
,然后将文件更改为
require("jsclass");
var PMP_Abstract = new JS.Class({});