Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing `pino-pretty` module: `pino-pretty` must be installed separately

I'm using a adonis js project version 5 and node js version 14 and docker version 20 when i build the application things goes normallly but when i create a docker image and run a container docker i got this error any help please thank you node server.js

Error: Missing pino-pretty module: pino-pretty must be installed separately

at getPrettyStream (/app/node_modules/pino/lib/tools.js:188:13)

at normalizeArgs (/app/node_modules/pino/lib/tools.js:352:16)

at pino (/app/node_modules/pino/pino.js:78:28)

at getPino (/app/node_modules/@adonisjs/logger/build/src/getPino.js:38:99)

at new Logger (/app/node_modules/@adonisjs/logger/build/src/Logger.js:49:55)

at Application.setupLogger (/app/node_modules/@adonisjs/application/build/src/Application.js:320:23)

at Application.setup (/app/node_modules/@adonisjs/application/build/src/Application.js:513:14)

at HttpServer.wire (/app/node_modules/@adonisjs/core/build/src/Ignitor/HttpServer/index.js:48:32)

at HttpServer.start (/app/node_modules/@adonisjs/core/build/src/Ignitor/HttpServer/index.js:146:24)

at Object.<anonymous> (/server.ts:21:4)

Done in 0.68s.

like image 413
sokida Avatar asked Oct 12 '25 10:10

sokida


2 Answers

I've fixed this by moving the pino-pretty package from devDependencies to production dependencies

like image 182
meez Avatar answered Oct 15 '25 00:10

meez


you have to build app with production env

NODE_ENV=production

like image 28
marek Avatar answered Oct 15 '25 01:10

marek