Cannot find module 'dotenv' when executing
Watermana opened this issue · comments
I've done all the steps to set up the node.js bot and have added the info to my .env file but it keeps throwing this error:
internal/modules/cjs/loader.js:883
throw err;
^
Error: Cannot find module 'dotenv'
Require stack:
- C:\Users\water\Documents\GitHub\defi-bot\src\index.js
←[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:725:27)←[39m
←[90m at Module.require (internal/modules/cjs/loader.js:952:19)←[39m
←[90m at require (internal/modules/cjs/helpers.js:88:18)←[39m
at Object. (C:\Users\water\Documents\GitHub\defi-bot\src\index.js:1:1)
←[90m at Module._compile (internal/modules/cjs/loader.js:1063:30)←[39m
←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)←[39m
←[90m at Module.load (internal/modules/cjs/loader.js:928:32)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:769:14)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)←[39m {
code: ←[32m'MODULE_NOT_FOUND'←[39m,
requireStack: [ ←[32m'C:\Users\water\Documents\GitHub\defi-bot\src\index.js'←[39m ]
}
none of the files have been moved around, although I did copy the .env file into the root directory as well as the \src folder just to be sure it could find the file it is looking for. Has anyone else come across this issue? What do I need to do so that it can find the file?