WIN7下 DOWN NodeClub 启动成功后报错.
发布于 10 年前 作者 algz 4760 次浏览 最后一次编辑是 8 年前

当http://localhost:3000/访问后.报以下错误.提示 'E:\layout.html’这个是什么意思?还需哪里配置?

“D:\Program Files\JetBrains\WebStorm 8.0.2\bin\runnerw.exe” “D:\Program Files\nodejs\node.exe” app.js NodeClub listening on port 3000 in development mode God bless love… You can debug your app with http://localhost.cnodejs.org:3000 Error: ENOENT, no such file or directory 'E:\layout.html’ at Object.fs.openSync (fs.js:427:18) at fs.readFileSync (fs.js:284:15) at Object.exports.renderFile (E:\nodejs\nodeclub-master\nodeclub-master\node_modules\ejs\lib\ejs.js:312:9) at module.exports (E:\nodejs\nodeclub-master\nodeclub-master\node_modules\ejs-locals\index.js:85:7) at E:\nodejs\nodeclub-master\nodeclub-master\node_modules\ejs-locals\index.js:131:7 at Object.exports.renderFile (E:\nodejs\nodeclub-master\nodeclub-master\node_modules\ejs\lib\ejs.js:317:3) at View.module.exports [as engine] (E:\nodejs\nodeclub-master\nodeclub-master\node_modules\ejs-locals\index.js:85:7) at View.render (E:\nodejs\nodeclub-master\nodeclub-master\node_modules\express\lib\view.js:76:8) at Function.app.render (E:\nodejs\nodeclub-master\nodeclub-master\node_modules\express\lib\application.js:502:10) at ServerResponse.res.render (E:\nodejs\nodeclub-master\nodeclub-master\node_modules\express\lib\response.js:783:7) at ServerResponse.cls_wrapRender [as render] (E:\nodejs\nodeclub-master\nodeclub-master\node_modules\newrelic\lib\instrumentation\express.js:151:21) at E:\nodejs\nodeclub-master\nodeclub-master\controllers\site.js:42:11 at [object Object]._all (E:\nodejs\nodeclub-master\nodeclub-master\node_modules\eventproxy\lib\eventproxy.js:258:16) at [object Object].EventProxy.trigger (E:\nodejs\nodeclub-master\nodeclub-master\node_modules\eventproxy\lib\eventproxy.js:144:22) at E:\nodejs\nodeclub-master\nodeclub-master\node_modules\eventproxy\lib\eventproxy.js:501:21 at Promise.<anonymous> (E:\nodejs\nodeclub-master\nodeclub-master\proxy\topic.js:74:14) at Promise.<anonymous> (E:\nodejs\nodeclub-master\nodeclub-master\node_modules\mongoose\lib\promise.js:120:8) at Promise.EventEmitter.emit (events.js:95:17) at Promise.emit (E:\nodejs\nodeclub-master\nodeclub-master\node_modules\mongoose\lib\promise.js:59:38) at Promise.complete (E:\nodejs\nodeclub-master\nodeclub-master\node_modules\mongoose\lib\promise.js:70:20) at cb (E:\nodejs\nodeclub-master\nodeclub-master\node_modules\mongoose\lib\query.js:837:32) at E:\nodejs\nodeclub-master\nodeclub-master\node_modules\mongoose\lib\utils.js:408:16 at E:\nodejs\nodeclub-master\nodeclub-master\node_modules\mongoose\node_modules\mongodb\lib\mongodb\cursor.js:153:9 at E:\nodejs\nodeclub-master\nodeclub-master\node_modules\mongoose\node_modules\mongodb\lib\mongodb\cursor.js:193:11 at cb_callbackProxy (E:\nodejs\nodeclub-master\nodeclub-master\node_modules\newrelic\lib\instrumentation\mongodb.js:57:37) at E:\nodejs\nodeclub-master\nodeclub-master\node_modules\newrelic\node_modules\continuation-local-storage\context.js:76:17 at E:\nodejs\nodeclub-master\nodeclub-master\node_modules\mongoose\node_modules\mongodb\lib\mongodb\cursor.js:539:35 at Cursor.close (E:\nodejs\nodeclub-master\nodeclub-master\node_modules\mongoose\node_modules\mongodb\lib\mongodb\cursor.js:782:5) at Cursor.nextObject (E:\nodejs\nodeclub-master\nodeclub-master\node_modules\mongoose\node_modules\mongodb\lib\mongodb\cursor.js:539:17) at Cursor.wrappedNextObject [as nextObject] (E:\nodejs\nodeclub-master\nodeclub-master\node_modules\newrelic\lib\instrumentation\mongodb.js:43:55) at [object Object].commandHandler (E:\nodejs\nodeclub-master\nodeclub-master\node_modules\mongoose\node_modules\mongodb\lib\mongodb\cursor.js:516:14) at [object Object].g (events.js:180:16) at [object Object].EventEmitter.emit (events.js:106:17) at Db._callHandler (E:\nodejs\nodeclub-master\nodeclub-master\node_modules\mongoose\node_modules\mongodb\lib\mongodb\db.js:1439:25) at E:\nodejs\nodeclub-master\nodeclub-master\node_modules\mongoose\node_modules\mongodb\lib\mongodb\connection\server.js:425:30 at [object Object].MongoReply.parseBody (E:\nodejs\nodeclub-master\nodeclub-master\node_modules\mongoose\node_modules\mongodb\lib\mongodb\responses\mongo_reply.js:127:5) at [object Object].<anonymous> (E:\nodejs\nodeclub-master\nodeclub-master\node_modules\mongoose\node_modules\mongodb\lib\mongodb\connection\server.js:384:22) at [object Object].EventEmitter.emit (events.js:95:17) at [object Object].<anonymous> (E:\nodejs\nodeclub-master\nodeclub-master\node_modules\mongoose\node_modules\mongodb\lib\mongodb\connection\connection_pool.js:136:13) at [object Object].EventEmitter.emit (events.js:98:17) at Socket.<anonymous> (E:\nodejs\nodeclub-master\nodeclub-master\node_modules\mongoose\node_modules\mongodb\lib\mongodb\connection\connection.js:297:22) at Socket.EventEmitter.emit (events.js:95:17) at Socket.<anonymous> (stream_readable.js:745:14) at Socket.EventEmitter.emit (events.js:92:17) at emitReadable (_stream_readable.js:407:10) at emitReadable (_stream_readable.js:403:5) at readableAddChunk (_stream_readable.js:165:9) at Socket.Readable.push (_stream_readable.js:127:10) at TCP.onread (net.js:528:21) at TCP.onread (E:\nodejs\nodeclub-master\nodeclub-master\node_modules\newrelic\node_modules\continuation-local-storage\node_modules\async-listener\glue.js:177:31)

3 回复

好吧.自行解决了. 原来是故意出的个BUG. app.js 53行: app.locals._layoutFile = ‘/layout.html’; //绝对路径 改成 app.locals._layoutFile = ‘./layout.html’; //相对路径.

感谢,我也遇到这个问题了

回到顶部