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

325
Views
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 answers
Answer question

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