I am trying to run the everyauth example. However, it is showing the following error
ReferenceError: /Users/tyler/clicker/everyauth/example/views/home.jade:1
> 1| - if (!everyauth.loggedIn)
2| h2 Not Authenticated
3| #register
4| a(href='/register') Register
everyauth is not defined
I have install everyauth. And when I do sudo node server.js to run the example,it shows the app running. However, when I visit the site at localhost:3000, it shows the above error.
It is showing something like everyauth is not defined. What could be the reason? I mean everyauth is definitely installed. Could it be that it is no imported properly?
My guess is you have installed express 3.x and the everyauth example is still using app.dynamicHelpers
from express 2.x. Try again with express 2.x installed.
Specificaly this line of code in everyauth calls app.dynamicHelpers
which is an express 2.X API that does not exist in express 3.x. And this line in the everyauth package.json further supports the notion that this example hasn't been updated for express 3.0.
The solution short term for you is:
npm uninstall express
npm install express@2.5.11
Long term, the everyauth example needs to be updated for the express 3.x API.