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 Express Basics Using Templates with Express Using Pug in Your Express App

keep getting an error when start up the site in local host

koenhaentjens@iMac-van-koen-2 flashcards % node app.js The application is running on localhost:3000! Error: /Users/koenhaentjens/flashcards/views/index.pug:6:1 4| title Landing Page 5| body

6| h1 sqgjqodhqme herqjnq -------^ 7| p mwdjhqer,kn qe ,qreqret,ww;,w 8|

Invalid indentation, you can use tabs or spaces but not both at makeError (/Users/koenhaentjens/flashcards/node_modules/pug-error/index.js:34:13) at Lexer.error (/Users/koenhaentjens/flashcards/node_modules/pug-lexer/index.js:62:15) at Lexer.indent (/Users/koenhaentjens/flashcards/node_modules/pug-lexer/index.js:1498:14) at Lexer.callLexerFunction (/Users/koenhaentjens/flashcards/node_modules/pug-lexer/index.js:1647:23) at Lexer.advance (/Users/koenhaentjens/flashcards/node_modules/pug-lexer/index.js:1688:12) at Lexer.callLexerFunction (/Users/koenhaentjens/flashcards/node_modules/pug-lexer/index.js:1647:23) at Lexer.getTokens (/Users/koenhaentjens/flashcards/node_modules/pug-lexer/index.js:1706:12) at lex (/Users/koenhaentjens/flashcards/node_modules/pug-lexer/index.js:12:42) at Object.lex (/Users/koenhaentjens/flashcards/node_modules/pug/lib/index.js:104:9) at Function.loadString as string ^C koenhaentjens@iMac-van-koen-2 flashcards % node app.js The application is running on localhost:3000! Error: /Users/koenhaentjens/flashcards/views/index.pug:6:1 4| title Landing Page 5| body

6| h1 sqgjqodhqme herqjnq -------^ 7| p mwdjhqer,kn qe ,qreqret,ww;,w 8|

Invalid indentation, you can use tabs or spaces but not both at makeError (/Users/koenhaentjens/flashcards/node_modules/pug-error/index.js:34:13) at Lexer.error (/Users/koenhaentjens/flashcards/node_modules/pug-lexer/index.js:62:15) at Lexer.indent (/Users/koenhaentjens/flashcards/node_modules/pug-lexer/index.js:1498:14) at Lexer.callLexerFunction (/Users/koenhaentjens/flashcards/node_modules/pug-lexer/index.js:1647:23) at Lexer.advance (/Users/koenhaentjens/flashcards/node_modules/pug-lexer/index.js:1688:12) at Lexer.callLexerFunction (/Users/koenhaentjens/flashcards/node_modules/pug-lexer/index.js:1647:23) at Lexer.getTokens (/Users/koenhaentjens/flashcards/node_modules/pug-lexer/index.js:1706:12) at lex (/Users/koenhaentjens/flashcards/node_modules/pug-lexer/index.js:12:42) at Object.lex (/Users/koenhaentjens/flashcards/node_modules/pug/lib/index.js:104:9) at Function.loadString as string ^C koenhaentjens@iMac-van-koen-2 flashcards % node app.js The application is running on localhost:3000! Error: /Users/koenhaentjens/flashcards/views/index.pug:6:1 4| title Landing Page 5| body

6| h1 sqgjqodhqme -------^ 7|
8| p mwdjhqer,kn qe ,qreqret,ww;,w 9|

Invalid indentation, you can use tabs or spaces but not both at makeError (/Users/koenhaentjens/flashcards/node_modules/pug-error/index.js:34:13) at Lexer.error (/Users/koenhaentjens/flashcards/node_modules/pug-lexer/index.js:62:15) at Lexer.indent (/Users/koenhaentjens/flashcards/node_modules/pug-lexer/index.js:1498:14) at Lexer.callLexerFunction (/Users/koenhaentjens/flashcards/node_modules/pug-lexer/index.js:1647:23) at Lexer.advance (/Users/koenhaentjens/flashcards/node_modules/pug-lexer/index.js:1688:12) at Lexer.callLexerFunction (/Users/koenhaentjens/flashcards/node_modules/pug-lexer/index.js:1647:23) at Lexer.getTokens (/Users/koenhaentjens/flashcards/node_modules/pug-lexer/index.js:1706:12) at lex (/Users/koenhaentjens/flashcards/node_modules/pug-lexer/index.js:12:42) at Object.lex (/Users/koenhaentjens/flashcards/node_modules/pug/lib/index.js:104:9) at Function.loadString as string ^C koenhaentjens@iMac-van-koen-2 flashcards % node app.js The application is running on localhost:3000! Error: /Users/koenhaentjens/flashcards/views/index.pug:6:1 4| title Landing Page 5| body

6| h1 sqgjqodhqme -------^ 7| p mwdjhqer,kn qe ,qreqret,ww;,w

Invalid indentation, you can use tabs or spaces but not both at makeError (/Users/koenhaentjens/flashcards/node_modules/pug-error/index.js:34:13) at Lexer.error (/Users/koenhaentjens/flashcards/node_modules/pug-lexer/index.js:62:15) at Lexer.indent (/Users/koenhaentjens/flashcards/node_modules/pug-lexer/index.js:1498:14) at Lexer.callLexerFunction (/Users/koenhaentjens/flashcards/node_modules/pug-lexer/index.js:1647:23) at Lexer.advance (/Users/koenhaentjens/flashcards/node_modules/pug-lexer/index.js:1688:12) at Lexer.callLexerFunction (/Users/koenhaentjens/flashcards/node_modules/pug-lexer/index.js:1647:23) at Lexer.getTokens (/Users/koenhaentjens/flashcards/node_modules/pug-lexer/index.js:1706:12) at lex (/Users/koenhaentjens/flashcards/node_modules/pug-lexer/index.js:12:42) at Object.lex (/Users/koenhaentjens/flashcards/node_modules/pug/lib/index.js:104:9) at Function.loadString as string

1 Answer

Invalid indentation, you can use tabs or spaces but not both at makeError

Make sure your tabs and spaces are the same.

Also check the version of pug that you are using. Version 2.0.0 is buggy.