Node: v15.14.0 npm: 7.10.0
Estava tomando erro direto:
/home/node/app/index.js:4
conexao.connect(erro => {
^
TypeError: conexao.connect is not a function
at Object.<anonymous> (/home/node/app/index.js:4:9)
at Module._compile (node:internal/modules/cjs/loader:1109:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
at Module.load (node:internal/modules/cjs/loader:989:32)
at Function.Module._load (node:internal/modules/cjs/loader:829:14)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
at node:internal/main/run_main_module:17:47
[nodemon] app crashed - waiting for file changes before starting...
Porém verificando documentação do MariaDB com NodeJS vi que faltava /callback
no declaração de const do banco. Funcionou após alterar a linha:
const mariadb = require('mariadb/callback')
Do arquivo ./infraestrutura/conexao.js
Espero ter ajudado.