Cannot find module 'timers' error

In my code when I use the following line const { MongoClient, ServerApiVersion } = require("mongodb"); I get the error Cannot find module ‘timers’ ` but when I remove that line the error goes away

Hi @Zia_Ullah_Khan,

Welcome to the MongoDB Community forums :sparkles:

Could you please share the MongoDB Node.js driver version you are using and the Node.js version? I suspect it is happening due to some version dependency issue.

Also, try removing your node_modules folder and reinstalling it again with the command npm i to see if it resolves the problem.

Best regards,
Kushagra