Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

169
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda