Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Build a Simple Dynamic Site with Node.js Creating a Basic Template Engine in Node.js Reading from Files

Sean Flanagan
Sean Flanagan
33,235 Points

Error message in console

Hi.

I got as far as 13 minutes 43 seconds into the video.

I run the server, preview it, open Port 3000, and the workspace is unavailable. In the console, I get this message:

Server running at http://<workspace-url>/                                                                 
fs.js:641                                                                                                 
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);                            
                 ^                                                                                        

Error: ENOENT: no such file or directory, open './views/search.html'                                      
    at Error (native)                                                                                     
    at Object.fs.openSync (fs.js:641:18)                                                                  
    at Object.fs.readFileSync (fs.js:509:33)                                                              
    at Object.view (/home/treehouse/workspace/renderer.js:5:25)                                           
    at Object.home (/home/treehouse/workspace/router.js:11:14)                                            
    at Server.<anonymous> (/home/treehouse/workspace/app.js:8:10)                                         
    at emitTwo (events.js:106:13)                                                                         
    at Server.emit (events.js:191:7)                                                                      
    at HTTPParser.parserOnIncoming [as onIncoming] (_http_server.js:546:12)                               
    at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23)

Here's my workspace:

https://w.trhou.se/edv4wbs24c

I'd appreciate any help please.

1 Answer

Seth Kroger
Seth Kroger
56,413 Points

You mistakenly gave the HTML file a .js extension instead of .html so the name is wrong. (I also noticed you're missing an openint < on the image tag in that file as well.)

Sean Flanagan
Sean Flanagan
33,235 Points

Hi Seth. I added the missing opening tag and changed the file extension. Well spotted. I've upvoted you and given you Best Answer. Thank you. :-)