我正在研究角电子施加。我正在尝试将Winston logger添加到我的应用程序。当我使用npm run electronic运行应用程序时配置了winston-logger.ts文件后,出现以下错误
ERROR in ./node_modules/winston/dist/winston/tail-file.js
Module not found: Error: Can't resolve 'fs' in 'C:\Users\node_modules\winston\dist\winston'
ERROR in ./node_modules/winston/dist/winston/transports/file.js
Module not found: Error: Can't resolve 'fs' in 'C:\Users\winston\dist\winston\transports'
ERROR in ./node_modules/winston/dist/winston/transports/http.js
Module not found: Error: Can't resolve 'http' in 'C:\Users\winston\dist\winston\transports'
ERROR in ./node_modules/winston/dist/winston/transports/http.js
Module not found: Error: Can't resolve 'https' in 'C:\Users\winston\dist\winston\transports'
ERROR in ./node_modules/logform/node_modules/colors/lib/system/supports-colors.js
Module not found: Error: Can't resolve 'os' in 'C:\Users\logform\node_modules\colors\lib\system'
ERROR in ./node_modules/winston/dist/winston/exception-handler.js
Module not found: Error: Can't resolve 'os' in 'C:\Users\winston\dist\winston'
ERROR in ./node_modules/winston/dist/winston/rejection-handler.js
Module not found: Error: Can't resolve 'os' in 'C:\Users\winston\dist\winston'
ERROR in ./node_modules/winston/dist/winston/transports/file.js
Module not found: Error: Can't resolve 'os' in 'C:\Users\winston\dist\winston\transports'
ERROR in ./node_modules/winston/dist/winston/transports/stream.js
Module not found: Error: Can't resolve 'os' in 'C:\Users\winston\dist\winston\transports'
ERROR in ./node_modules/winston/dist/winston/transports/console.js
Module not found: Error: Can't resolve 'os' in 'C:\Users\winston\dist\winston\transports'
ERROR in ./node_modules/winston/dist/winston/transports/file.js
Module not found: Error: Can't resolve 'path' in 'C:\Users\winston\dist\winston\transports'
ERROR in ./node_modules/winston/dist/winston/transports/file.js
Module not found: Error: Can't resolve 'zlib' in 'C:\Users\winston\dist\winston\transports'
解决方法
答案 0 :(得分:0)
需要使用Winston模块
0
仅要求不起作用。