Error: Cannot Find Module 'Timers/Promises

Error: Cannot Find Module 'Timers/Promises

It is not written that this module is needed in any of the codes I tried to download this module but it did not work please help me

Require stack:
- C:\Users\danie\Desktop\DiscordBot-Template-master\node_modules\@discordjs\rest\dist\lib\handlers\SequentialHandler.js
- C:\Users\danie\Desktop\DiscordBot-Template-master\node_modules\@discordjs\rest\dist\lib\RequestManager.js
- C:\Users\danie\Desktop\DiscordBot-Template-master\node_modules\@discordjs\rest\dist\index.js
- C:\Users\danie\Desktop\DiscordBot-Template-master\bot.js
←[90m    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15)←[39m
←[90m    at Function.Module._load (internal/modules/cjs/loader.js:730:27)←[39m
←[90m    at Module.require (internal/modules/cjs/loader.js:957:19)←[39m
←[90m    at require (internal/modules/cjs/helpers.js:88:18)←[39m
    at Object.<anonymous> (C:\Users\danie\Desktop\DiscordBot-Template-master\node_modules\←[4m@discordjs←[24m\rest\dist\lib\handlers\SequentialHandler.js:6:20)
←[90m    at Module._compile (internal/modules/cjs/loader.js:1068:30)←[39m
←[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)←[39m
←[90m    at Module.load (internal/modules/cjs/loader.js:933:32)←[39m
←[90m    at Function.Module._load (internal/modules/cjs/loader.js:774:14)←[39m
←[90m    at Module.require (internal/modules/cjs/loader.js:957:19)←[39m {
  code: ←[32m'MODULE_NOT_FOUND'←[39m,
  requireStack: [
    ←[32m'C:\\Users\\danie\\Desktop\\DiscordBot-Template-master\\node_modules\\@discordjs\\rest\\dist\\lib\\handlers\\SequentialHandler.js'←[39m,
    ←[32m'C:\\Users\\danie\\Desktop\\DiscordBot-Template-master\\node_modules\\@discordjs\\rest\\dist\\lib\\RequestManager.js'←[39m,
    ←[32m'C:\\Users\\danie\\Desktop\\DiscordBot-Template-master\\node_modules\\@discordjs\\rest\\dist\\index.js'←[39m,
    ←[32m'C:\\Users\\danie\\Desktop\\DiscordBot-Template-master\\bot.js'←[39m
  ]
}
1

2 Answers

It is most probably due to incompatible node version, consider downloading node.js v16 and above if it is already at v16 consider updating your types by running the following in the shell.

npm install --save-dev @types/node@latest

This issue can be solved by simple updating your node environment to node 16.x

The easiest way of doing this is by using nvm

nvm install 16
nvm use 16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

James H. Sterling
Author

James H. Sterling

James Sterling reports on renewable energy developments, climate policy, ecological conservation, and green tech innovations around the globe.