Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

159
Views
exphbs is not a function in express-handlebars

I am learning by watching tutorials. I don't know what type of error is and how to solve this error.
terminal give me this error app.engine('handlebars', exphbs()); ^

TypeError: exphbs is not a function

const express = require('express');

const path = require('path')
const port = 3000;
const app = express();


var exphbs  = require('express-handlebars');


app.engine('handlebars', exphbs());
app.set('view engine', 'handlebars');

app.use(express.static(path.join(__dirname, "static")));
app.use('/', require(path.join(__dirname, 'routes/blog.js')))



                     

TypeError: exphbs is not a function

app.listen(port, ()=>{
    console.log(`blog app running at http://localhost:${port} `);

})
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Look at the documentation for the module you are using.

import { engine } from 'express-handlebars';
...
app.engine('handlebars', engine());

It uses ES6 syntax but shows that the engine is available from the engine property of the module and not the top level export.

In your syntax, that would be:

app.engine('handlebars', exphbs.engine());
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!