Winston: Winston 3.2 Uncaught TypeError: fs.existsSync is not a function

Created on 10 Apr 2019  Â·  10Comments  Â·  Source: winstonjs/winston

  • _winston version 3.2
  • _Operating System? macOS
  • Node JS, React framework

What is the problem?

winstonLogger.Log() fails with the exception:

Uncaught TypeError: fs.existsSync is not a function
at File._createLogDirIfNotExist (file.js:804)
at new File (file.js:132)
at Object. (mylogger.js:16)
at webpack_require (bootstrap 284d16fcfe1dcfa44176:676)
at fn (bootstrap 284d16fcfe1dcfa44176:87)
at Object. (mymodule.js:5)
at webpack_require (bootstrap 284d16fcfe1dcfa44176:676)
at fn (bootstrap 284d16fcfe1dcfa44176:87)
at Object. (app.js:21)
at webpack_require (bootstrap 284d16fcfe1dcfa44176:676)

What do you expect to happen instead?

I expect the .log() function to log to a file transport

Other information