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

326
Visualizações
TypeScript | Facing Error while trying to import a dependency

I am not used to using node js and typescript.

I tried importing Paytm dependency using the following code: npm install paytmchecksum or by adding the below code in package.json

"dependencies": {
    ...
    "paytmchecksum": "^1.5.0"
    ...
}

Now, I am using firebase, typescript and node.js. When I try importing, using

import PaytmChecksum from "../node_modules/PaytmChecksum";
import PaytmChecksum from "paytmchecksum";

or any other thing. There are just errors. I believe maybe because the dependency is to be used with javascript rather than typescript.

I get the following error:

Could not find a declaration file for module '../node_modules/PaytmChecksum'. 'd:/firebase-functions/functions/node_modules/PaytmChecksum/PaytmChecksum.js' implicitly has an 'any' type.

sometimes I get this,

Could not find a declaration file for module 'paytmchecksum'. 'D:/firebase-functions/functions/node_modules/paytmchecksum/PaytmChecksum.js' implicitly has an 'any' type. Try npm i --save-dev @types/paytmchecksum if it exists or add a new declaration (.d.ts) file containing declare module 'paytmchecksum';

What is the workaround for this problem?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You either need to create your own type declarations file or use @ts-ignore on the line before the import.

If you create your own type.d.ts file, you will need to make sure that it is included the project in your tsconfig.json project file.

The type file can be as simple as one line (./mytypes/paytmchecksum.d.ts):

declare module 'paytmchecksum';

This simply gets rid of the implied any and makes it explicit. You won't get any intellisense or type checking, but it will fix the error. You could go the extra mile and create a full type-definition file. If you, do you should add it to the @types repository so others can use it.

Then just add include to your tsconfig.json file:

{ "include": [
  "mytypes/paytmchecksum.d.ts"
  ]
}
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