pinojs / pino-http

🌲 high-speed HTTP logger for Node.js
MIT License
539 stars 117 forks source link

CLI not installing #336

Closed chaseWilliams closed 5 months ago

chaseWilliams commented 5 months ago

I've been able to use pino-http for months, but recently something broke and now pino-http isn't recognized as a command anymore. I'm not sure what happened, may be my fault.

with this as delete_me.js

'use strict'

const http = require('http')
const server = http.createServer(handle)

const logger = require('pino-http')()

function handle (req, res) {
  logger(req, res)
  req.log.info('something else')
  res.end('hello world')
}

server.listen(3000)

Running node delete_me.js | pino-http returns zsh: command not found: pino-pretty and no further output, even after hitting the server and getting a response

jsumners commented 5 months ago

pino-http does not provide a CLI interface. You can see that there is not a bin field in the package.json: https://github.com/pinojs/pino-http/blob/bccda3c8e54b4d29c0a3a9497d84d39026e7e743/package.json

chaseWilliams commented 5 months ago

ok that makes sense. Why then does piping node logs to it like node delete_me.js | pino-http not work for me? Am I doing something wrong here?

jsumners commented 5 months ago

I believe you are looking for https://github.com/pinojs/pino-pretty

chaseWilliams commented 5 months ago

I'm so sorry you're right, didn't notice those were two separate names. thanks for pointing me back to that