启动全新的生成器构建的应用程序时出错

时间:2018-03-06 21:38:59

标签: node.js express

格林妮。试着从一个新的Express项目开始,我已经遇到了麻烦。我使用生成器来启动我的应用程序(express --view=handlebars sms_alarm_nodejs),我收到了这个错误:

Error: Failed to lookup view "error" in views directory "c:\Users\joe_t\workspace\sms_alarm_nodejs\views"
application.js:630
    at Function.render (c:\Users\joe_t\workspace\sms_alarm_nodejs\node_modules\express\lib\application.js:580:17)
    at ServerResponse.render (c:\Users\joe_t\workspace\sms_alarm_nodejs\node_modules\express\lib\response.js:971:7)
    at c:\Users\joe_t\workspace\sms_alarm_nodejs\app.js:43:7
    at Layer.handle_error (c:\Users\joe_t\workspace\sms_alarm_nodejs\node_modules\express\lib\router\layer.js:71:5)
    at trim_prefix (c:\Users\joe_t\workspace\sms_alarm_nodejs\node_modules\express\lib\router\index.js:315:13)
    at c:\Users\joe_t\workspace\sms_alarm_nodejs\node_modules\express\lib\router\index.js:284:7
    at Function.process_params (c:\Users\joe_t\workspace\sms_alarm_nodejs\node_modules\express\lib\router\index.js:335:12)
    at next (c:\Users\joe_t\workspace\sms_alarm_nodejs\node_modules\express\lib\router\index.js:275:10)
    at Layer.handle_error (c:\Users\joe_t\workspace\sms_alarm_nodejs\node_modules\express\lib\router\layer.js:67:12)
    at trim_prefix (c:\Users\joe_t\workspace\sms_alarm_nodejs\node_modules\express\lib\router\index.js:315:13)

我错过了app.js中的视图引用吗?我假设应用程序生成器会处理这个让我开始。我可以使用车把吗?我看到的样品使用了哈巴狗。

1 个答案:

答案 0 :(得分:0)

修正了它。我不得不使用public frmMain ( ) { InitializeComponent ( ); pbxMoveIt.BringToFront ( ); gbx1.AllowDrop = true; gbx2.AllowDrop = true; lblStatus.Text = "GUI Status: Started"; gbx1.MouseEnter += gbx_MouseEnter; gbx1.MouseLeave += gbx_MouseLeave; gbx1.MouseUp += gbx_MouseUp; gbx2.MouseEnter += gbx_MouseEnter; gbx2.MouseLeave += gbx_MouseLeave; gbx2.MouseUp += gbx_MouseUp; } private void gbx_MouseEnter ( object sender, EventArgs e ) { // useful code // ... } private void gbx_MouseLeave ( object sender, EventArgs e ) { // useful code // ... } private void gbx_MouseUp ( object sender, EventArgs e ) { // useful code // ... } 作为生成器参数。