i sent files node.js app (which working without issues online) , i'm trying set on windows machine.
i have node server running, i'm stuck trying load app. can navigate directory node command prompt, , there's app.js
(plus folders config
, components
etc) in there i've been trying run, getting following error:
d:\my-directory\game-master>node app.js module.js:327 throw err; ^ error: cannot find module 'config' @ function.module._resolvefilename (module.js:325:15) @ function.module._load (module.js:276:25) @ module.require (module.js:353:17) @ require (internal/module.js:12:17) @ object.<anonymous> (d:\posao\aktivni projekti\smart rebellion\game-master \app.js:7:10) @ module._compile (module.js:409:26) @ object.module._extensions..js (module.js:416:10) @ module.load (module.js:343:32) @ function.module._load (module.js:300:12) @ function.module.runmain (module.js:441:10)
the thing is, there no file titled module.js
in directory. presume it's built in node.js file, how troubleshoot this?
my best reading of error there should config.js
file somewhere, doesn't make sense because these same exact files work no hickups on remote server.
if want require('./config')
, config
directory, file ./config/index.js
should exist.
you can't require('config')
however, because node.js try find in node_modules
.
check out node.js modules documentation require
algorithm explained.
Comments
Post a Comment