Build Web Apps with Expressjs

Has anyone worked on “Build Web Apps with Expressjs” recently? Currently using the Cloud9 env to do my work.

I’m stuck at the “Jade” challenge. I believe that I have the right code, but get an error when trying to verify the solution. “Error: Cannot find module ‘jade’”

I’m tempted to just install expressworks on my laptop and complete the challenges there. Any suggestions? Thanks

1 Like

Not sure if this helps but Jade is now Pug and likely has breaking changes with Jade. You may need to either install an older version of Jade, or look up the documentation for Pug and use the current methods, etc.

Does that help?

When I went through that I couldn’t get it to work either. I ended up just skipping it. So unless you intend to use jade/pug in the near future, I wouldn’t worry about it.

It helps a bit. I went forward and tried to get the solution working by using pug. This involved:

  • npm install pug --save
  • cd /home/ubuntu/.nvm/versions/node/v4.1.2/lib/node_modules/expressworks/exercises/jade/templates
  • cp index.jade index.pug

In the code, I had to tweak the line that set the view engine to pug.
app.set('view engine', 'pug');

1 Like

it’s worth getting jade/pug to work, you may not choose to work with it a lot but knowing it or a similar templatling language is necessary for full stack. (you can also use react/angular/ejs/etc)

I was able to get this assignment work with both Jade v1.11.0 and Pug v0.1.0 by following the instructions/hints. To get Pug to work, just replace all instances of “jade” with “pug”.

Also, don’t forget to npm install Jade or Pug.

Thanks, I was stuck on this thing for weeks (not literally) trying to find out what the error was. Did this, then the verify flashed for a millisecond and I passed. :slight_smile:

1 Like