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

395
Views
Visual Studio Code cannot find module 'typegram/callback'

im working on a telegram bot using the telegraf package. (version 4.1.1)

everything was working until i started using more modules from the telegraf package like Extra and mark-up.

I started getting this error:

internal/modules/cjs/loader.js:800
    throw err;
    ^
Error: Cannot find module 'typegram/callback'
Require stack:
- C:\gitprojects\bot\node_modules\telegraf\lib\telegram-types.js
- C:\gitprojects\bot\node_modules\telegraf\lib\context.js
- C:\gitprojects\bot\node_modules\telegraf\lib\composer.js
- C:\gitprojects\bot\node_modules\telegraf\lib\telegraf.js
- C:\gitprojects\bot\node_modules\telegraf\lib\index.js
- C:\gitprojects\bot\index.js
←[90m    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)←[39m
←[90m    at Function.Module._load (internal/modules/cjs/loader.js:690:27)←[39m
←[90m    at Module.require (internal/modules/cjs/loader.js:852:19)←[39m
←[90m    at require (internal/modules/cjs/helpers.js:74:18)←[39m
    at Object.<anonymous> (C:\gitprojects\bot\node_modules\←[4mtelegraf←[24m\lib\telegram-types.js:16:14)
←[90m    at Module._compile (internal/modules/cjs/loader.js:959:30)←[39m
←[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)←[39m
←[90m    at Module.load (internal/modules/cjs/loader.js:815:32)←[39m
←[90m    at Function.Module._load (internal/modules/cjs/loader.js:727:14)←[39m
←[90m    at Module.require (internal/modules/cjs/loader.js:852:19)←[39m {
  code: ←[32m'MODULE_NOT_FOUND'←[39m,
  requireStack: [
    ←[32m'C:\\gitprojects\\bot\\node_modules\\telegraf\\lib\\telegram-types.js'←[39m,
    ←[32m'C:\\gitprojects\\bot\\node_modules\\telegraf\\lib\\context.js'←[39m,
    ←[32m'C:\\gitprojects\\bot\\node_modules\\telegraf\\lib\\composer.js'←[39m,
    ←[32m'C:\\gitprojects\\bot\\node_modules\\telegraf\\lib\\telegraf.js'←[39m,
    ←[32m'C:\\gitprojects\\bot\\node_modules\\telegraf\\lib\\index.js'←[39m,
    ←[32m'C:\\gitprojects\\bot\\index.js'←[39m
  ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bot@1.0.0 start: `node index.js`
npm ERR! Exit status 1

'typegram/callback' is installed but is a typescript file,i don't have typescript installed but i didn't have issues before the error.

I reverted to my latest working build but the error hasn't changed..

right now this is the only line of code:

const { Telegraf } = require('telegraf');

Any tips?

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Solved by downgrading to 4.1.0 version of the package.

over 4 years ago · Santiago Trujillo Report

0

Telegraf 1.4.x requires Node 12.x.x ++

Upgrade to the latest Node LTS (14) - you should be ok.

over 4 years ago · Santiago Trujillo Report

0

Well... in case anyone ever gets this error here is how i solved it.

after avoiding this issue by crying, sleeping and watching stupid youtube videos (shout out to Sseth).

ive reinstalled everything i could, nothing helped. checked npm version and noticed my code appeared as a installed package, i thought "Die" and removed it. for some reason that fixed it. if anyone knows the reason behind this behavior i would love to know.

you're all great, have a good one.

over 4 years ago · Santiago Trujillo 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!