NITIN RAI
NITIN RAI

Reputation: 11

Could not find a declaration file for module 'jsonwebtoken'. -pathname- implicitly has an 'any' type

I was working on a backend project, using node.js and express.js.

I need to use the json web token, after installing it via npm i jsonwebtoken I get in my node_modules.

The problem is this when I require that module in my project is says :

Could not find a declaration file for module 'jsonwebtoken'. 'c:/Web Development/Odin Project/Projects/Blog_Api/backend_api/node_modules/jsonwebtoken/index.js' implicitly has an 'any' type.
Try npm i --save-dev @types/jsonwebtoken if it exists or add a new declaration (.d.ts) file containing `declare module 'jsonwebtoken';`ts(7016)":

Also before the module I see 3 dots.

I have tried installing it as dev dependencies but no luck. I have watched tutorials about using json web token and they didn't face this issue.

Upvotes: 1

Views: 761

Answers (0)

Related Questions