New Relic's Node.js agent is publicly available on the Node Package Manager (npm) repository as well as on New Relic's Github repo for Node.js. Before you install the Node.js agent, make sure your application meets New Relic's system requirements.
View installation video
Before installing New Relic, you may want to view the video tutorials available through New Relic University.
Install the Node.js agent
As explained in this section, be sure to add
require('newrelic'); as the first line of your app's main module.
To install the Node.js agent for New Relic:
- Ensure you meet the system requirements. In particular, ensure you are using a supported version of Node.
- Use the command
npm install newrelic --savefor each application you want to monitor.
- From node_modules/newrelic, copy
newrelic.jsinto the root directory of your app.
require('newrelic');as the first line of your app's main module.
- Optional: For additional Node.js runtime-level statistics, ensure the
@newrelic/native-metricspackage is installed.
Check your app's performance
Keep your Node.js agent up-to-date
For more help
Additional documentation resources include:
- Node.js agent configuration (hierarchy of configuration options and an explanation of server-side and configuration file options)
- The New Relic user interface (getting the most out of using New Relic)
- Finding help (resources available through the online Help Center)
- Upgrading the Node.js agent (migration guide for upgrading to new major versions of the agent)