Answer the question
In order to leave comments, you need to log in
Why can't the index view be found?
I'm getting an error when going to " localhost:3000 " it says this:
Translation into Russian:
Could not find the view "index" in the view directory "C:\Users\User\Desktop\ac\views"
Error: Could not find the view "index" in the views directory "C:\Users\User\Desktop\ac\views"
in Function.render (C:\Users\User\Desktop\ac\node_modules\express\lib\application.js:580:17)
in ServerResponse.render (C:\Users\User\Desktop\ac\node_modules\express\lib\response.js:1008:7)
in C:\Users\User\Desktop\acc\routes\index.js:23: nine
in Layer.handle [as handle_request] (C:\Users\User\Desktop\ac\node_modules\express\lib\router\layer.js:95:5)
to the following (C:\Users\User\Desktop\ac\ node_modules\express\lib\router\route.js:137:13)
in Route.dispatch (C:\Users\User\Desktop\acc\node_modules\express\lib\router\route.js:112:3)
in Layer .handle [as handle_request] (C:\Users\User\Desktop\ac\node_modules\express\lib\router\layer.js:95:5)
in C:\Users\User\Desktop\ac\node_modules\express\ lib\router\index.js:281:22
in Function.process_params (C:\Users\User\Desktop\acc\node_modules\express\lib\router\index.js:335:12)
to the following (C:\Users\User\Desktop\ac\node_modules\express\lib\router\index.js:275:10)
to Function.handle (C:\Users\User\Desktop\acc\node_modules\express\ lib\router\index.js:174:3)
on router (C:\Users\User\Desktop\acc\node_modules\express\lib\router\index.js:47:12)
in Layer.handle [as handle_request] (C:\Users\User\Desktop\acc\node_modules\express\lib\router\layer.js:95:5)
to trim_prefix (C:\Users\User\Desktop\acc\node_modules\express\lib\router\ index.js:317:13)
to C:\Users\User\Desktop\acc\node_modules\express\lib\router\index.js:284:7
in Function.process_params (C:\Users\User\Desktop\acc\node_modules\express\lib\router\index.js:335:12)
I have the "index" view in folders:
I tried pasting the original "index.jade" " and everything works with him, and if I put "index.hbs" then he cannot find this file. I thought that I should not have "handlebars", I tried to install it, the problem remained.
here is what is in router/index.js
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question