Could not find declaration module 'fawn'


I am trying to work on Mosh’s NodeJS tutorial. I am on lesson 8 of Mongoose-Modelling Relationships with Connected Data.

It requires me to use npm module Fawn. I have installed it in my root directory of my project file.
const Fawn = require(‘fawn’);

However when I try to load it into my project file, I am getting the following error: Could not find a declaration file for module ‘fawn’.

Has anyone had this same issue? Any help is much appreciated!

Not sure why. But keep in mind that, the way error works sometimes is by chaining and also catching. Just because it said so doesn’t mean there is any error here. It could be another issue. Sometimes, it could be a different irrelevant issue.

With that being said, sometimes when npm installing sometimes, it doesn’t save in package.json… Have you tried to check if it is installed correctly? Does the app run normally without fawn?? How about the spelling of coma in the require(‘fawn’)? Can you show the whole error stack?

In case anyone still has this issue, just rewrite “Fawn.init(mongoose)” as “Fawn.init(‘mongodb://localhost/foo’)” in your code, if you’re using the latest version of Fawn.