Raivo Laanemets. Software consultant.

Silence deprecation warnings in Express 4.x


ExpressJS writes deprecation warnings into the application's stderr:

express deprecated res.send(status): Use res.status(status).end() instead

This triggers false alarms if you use log monitoring for the error output. This is not desired in the production environment where you want focus on the actual errors. These messages are not silenced by using the NODE_ENV=production environment variable. To silence them, you also need to set the NO_DEPRECATION=express environment variable.

The best solution is to replace res.send calls but sometimes this is not easy for a larger application or for an application that uses external 3rd party packages that use res.send.

More information: https://github.com/strongloop/express/issues/2392.


Comments

No comments have been added so far.

Email is not displayed anywhere.
URLs (max 3) starting with http:// or https:// can be used. Use @Name to mention someone.