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

198
Views
No se puede registrar el complemento hapi-cron-job

Estoy tratando de programar cronjobs que se ejecutarán en un momento específico, estoy usando hapi-cron-job de hapi , cuando intento registrar el complemento, aparece el siguiente error.

 [1] "plugin.register" must be of type function at Object.exports.apply (D:\my_dir\Repositories\repo-cronjobs\node_modules\@hapi\hapi\lib\config.js:19:15) at internals.Server.register (D:\my_dir\Repositories\repo-cronjobs\node_modules\@hapi\hapi\lib\server.js:454:31) at processTicksAndRejections (internal/process/task_queues.js:95:5)

Encuentre la configuración mientras registra el complemento.

servidor.js

 const { plugins } = require('./register/index'); await server .register(plugins) .then(() => {}) .catch(err => { console.error('Plugin registeration failed!'); console.error(err); });

índice.js

 module.exports.plugins = [ // I have here other pluguns, passing this array for registration in server.js require("./hapi-cron-job-plugin") ];

hapi-cron-trabajo-plugin.js

 const hapiCronJob = require('hapi-cron-job') const plugin = { register: require('hapi-cron-job'), options: { jobs: [ { name: "diplay time", enabled: true, immediate: true, schedule: "every 1 s", execute: alertSystemAdminAndDispatcher, environments: ['development', 'staging'] } ], } } module.exports = plugin;

versión de nodoJS: v14.17.3

Hapi-cron-trabajo: "hapi-cron-job": "^2.0.1"

about 4 years ago · Juan Pablo Isaza
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!