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

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

0

Solved by downgrading to 4.1.0 version of the package.

over 4 years ago · Santiago Trujillo Relatório

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 Relatório

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 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