NodeClub最近更新的源码是不是有问题,报错
登陆的时候报错。
ReferenceError: User is not defined
at exports.login (D:\test\controllers\sign.js:129:3)
at callbacks (D:\test\node_modules\express\lib\router\index.js:272:11)
at param (D:\test\node_modules\express\lib\router\index.js:246:11)
at pass (D:\test\node_modules\express\lib\router\index.js:253:5)
at Router._dispatch (D:\test\node_modules\express\lib\router\index.js:280:5)
at Object.middleware [as handle] (D:\test\node_modules\express\lib\router\index.js:45:10)
at next (D:\test\node_modules\express\node_modules\connect\lib\http.js:204:15)
at next (D:\test\node_modules\express\node_modules\connect\lib\http.js:206:9)
at exports.send (D:\test\node_modules\express\node_modules\connect\lib\middleware\static.js:115:40)
at Object.static (D:\test\node_modules\express\node_modules\connect\lib\middleware\static.js:60:5)
5 回复
遇到相同问题
好像最近更新上去的错误好多,还是先不要更新为好。
对比以前的Tag, 在sign.js 文件开头添加如下代码,可解决楼主问题。
var models = require(’…/models’), User = models.User;
@Jackson 最近重构都是bug
如果需要部署,推荐用最新的tag进行部署。