4

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.

sokida
  • 433
  • 1
  • 8
  • 21

2 Answers2

4

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

meez
  • 3,783
  • 5
  • 37
  • 91
2

you have to build app with production env

NODE_ENV=production

marek
  • 56
  • 3
  • 3
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 20 '22 at 04:46