Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

334
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda