When trying to require two folders containing js files, I receive a throw error, returning that neither of the folders could be found. These modules clearly exist so I don't understand how I can't require them. At first I thought this had something to do with the contents of the js files, but if there's an error in the js files, surely the error would be specifically relevant to the js file contents, which it is not.
Instead it simply states that the modules could not be found
internal/modules/cjs/loader.js:960
throw err;
^
Error: Cannot find module './training'
Require stack:
- d:\nodejs_scripts\sessions\session1_05.05.20\main.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:957:15)
at Function.Module._load (internal/modules/cjs/loader.js:840:27)
at Module.require (internal/modules/cjs/loader.js:1019:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (d:\nodejs_scripts\sessions\session1_05.05.20\main.js:2:20)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
at Module.load (internal/modules/cjs/loader.js:977:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ 'd:\\nodejs_scripts\\sessions\\session1_05.05.20\\main.js' ]
}
I debugged both the ./training
contents, and the ./serializer
content and no errors were found in either. So the error must be occurring when trying to require the folders from main.js
. Is there something obvious i'm missing here?
Thanks in advance.