温斯顿的这个错误是什么?

时间:2018-07-20 06:04:52

标签: node.js winston

events.js:183
  throw er; // Unhandled 'error' event
  ^

Error: write after end
at writeAfterEnd (_stream_writable.js:236:12)
at WriteStream.Writable.write (_stream_writable.js:287:5)
at exports.File.File._write (/home/baopham/Documents/Projects/temp/api/node_modules/winston/lib/winston/transports/file.js:202:18)
at /home/baopham/Documents/Projects/temp/api/node_modules/winston/lib/winston/transports/file.js:438:12
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickDomainCallback (internal/process/next_tick.js:218:9)

我通过Winston登录。

winston.loggers.add('logger',{});
    winston.loggers.get('query').configure({
        transports: [
            new winston.transports.File({ dirname: 
            path.join(__dirname, '/../../../logs'), filename: 'query.log', timestamp: false })
        ]
    });
winston.loggers.get('query').info('CREATE ITEM');

节点v8.11.3

npm v5.6.0

这是什么错误? 我不知道它是否与npm有关

1 个答案:

答案 0 :(得分:0)

尝试此修复程序:

**将节点升级到8.10.x(实际上将npm降级到5.6.0)

**然后使用 $ npm install npm -g 更新npm(这会将npm更新为5.7.1)

现在npm安装将顺利进行。

参考:https://github.com/npm/npm/issues/19989