title: Why am I getting an error saying that expressJwt is not a function?
body: <p>So I am trying to implement this middleware in my code.</p>
  <pre><code>const expressJwt = require(&quot;express-jwt&quot;);
  
      function authJwt() {
        const secret = process.env.secret;
        return console.log(
          expressJwt({
            secret,
            algorithms: [&quot;HS256&quot;],
          })
        );
      }
      
      module.exports = authJwt;
  </code></pre>
  <p>But I am getting the following error - expressJwt is not a function</p>
  <p>I have done npm install express-jwt. I do not understand why this is giving me this error.</p>
  <p><a href="https://i.stack.imgur.com/hOFVk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hOFVk.png" alt="Error" /></a></p>