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 trialIsabelle Caspersson
6,679 PointsCan't load page - don't know why?
const express = require('express'); const app = express();
app.set('view engine', 'pug');
app.get('/', (req, res) => { res.render('index') });
app.listen(5500, () => { console.log('Its up and running') });
3 Answers
Andrea Zajicova
7,124 PointsHi Isabelle,
my error was that my 'views' folder was misplaced. It should be in the same directory as node modules, i.e. on the same level. Hope you worked it out, but I am leaving my comment here in case anybody else makes the same mistake as me:) Happy coding and debugging!
Liam Clarke
19,938 PointsHi Isabelle
From what you have provided, everything seems to be correct so here is a few things for you to double check:
- You have both express and pug installed as dependencies
- You are running the express server and accessing through the port 5500
- You are indenting correctly in your pug template
- There are no errors in your browser console and/or node console
- you have put your index.pug file in the "views" directory, with the correct spelling
Hope this helps!
Anthony Albertorio
22,624 PointsMake sure to update to pug@2.0.1 to solve the issue
Justin White
8,765 PointsJustin White
8,765 PointsThank you Andrea that solved my problem!
Frank Kynard
6,958 PointsFrank Kynard
6,958 PointsThis helped me as well thanks so much!!!