node.js - How to resolve Nodejs: Error: ENOENT: no such file or directory -


i have nodejs web app running on server successfully. i'm trying setup local copy on development server.

i have nodejs, npm , mongo installed have in production server error below occurs when try start node server

whats causing issue?

embah@devsertwo:~/node/nodeapp$ node app.js fs.js:640   return binding.open(pathmodule._makelong(path), stringtoflags(flags), mode);                  ^  error: enoent: no such file or directory, open '/home/embah/node/nodeapp/config/c onfig.json'     @ error (native)     @ object.fs.opensync (fs.js:640:18)     @ object.fs.readfilesync (fs.js:508:33)     @ object.<anonymous> (/home/embah/node/nodeapp/config/config.js:4:28)     @ module._compile (module.js:570:32)     @ object.module._extensions..js (module.js:579:10)     @ module.load (module.js:487:32)     @ trymoduleload (module.js:446:12)     @ function.module._load (module.js:438:3)     @ module.require (module.js:497:17)     @ require (internal/module.js:20:19)     @ object.<anonymous> (/home/embah/node/glorby/app.js:13:16)     @ module._compile (module.js:570:32)     @ object.module._extensions..js (module.js:579:10)     @ module.load (module.js:487:32)     @ trymoduleload (module.js:446:12)     @ function.module._load (module.js:438:3)     @ module.runmain (module.js:604:10)     @ run (bootstrap_node.js:394:7)     @ startup (bootstrap_node.js:149:9)     @ bootstrap_node.js:509:3 embah@devsertwo:~/node/nodeapp$ 

your app expecting find file @ /home/embah/node/nodeapp/config/config.json file not exist (which enoent means). either need create expected directory structure or else configure application such looks in correct directory config.json.


Comments