Tuesday, 9 May 2017

winston is not able to create the looger file on ubuntu machine

I have integrated winston logger in my nodejs app. Now winston is able to create log folder on my local windows machine successfully, but somehow it is not able to create the same folder on my aws ubuntu machine and it throws the following error:

return binding.mkdir(pathModule._makeLong(path),
                 ^

Error: EACCES: permission denied, mkdir 'log'
    at Error (native)
    at Object.fs.mkdirSync (fs.js:922:18)
    at Object.<anonymous> (/home/bitnami/quflipNodeAPI/utils/winstonLogger.js:7:8)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/bitnami/quflipNodeAPI/app.js:33:21)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3

Now how can I give sudo access in the file itself?



via M thaker

No comments:

Post a Comment