Troubleshoot your Node.js installation


If you have encountered any of these common problems after installing your New Relic Node.js agent, try these troubleshooting tips.


Some common problems users encounter after installing the New Relic Node.js agent include:

Not seeing data

To minimize the amount of bandwidth the Node.js agent consumes, New Relic only reports data once per minute. If you add the agent to tests that take less than a minute to run, it will not have time to report data to New Relic.

If you do not see transaction traces or other data after deploying the agent, this may be due to configuration, framework, or Apdex settings. Use New Relic Diagnostics to try to automatically identify the issue.

Installation problems
What to check Comments
Main module Ensure that you have added require('newrelic'); as the first line of the app's main module. If the require is added later, the Node.js agent may not properly instrument your application.
Conditional logic If you have any conditional logic in your require, move the conditional logic to your newrelic.js configuration file.
Frameworks For problems with supported frameworks, make sure you are using Connect, Express, Hapi, Kraken, or Restify. There are other Node.js frameworks, but New Relic does not support all of them.
Apdex For problems with your Apdex results, try adjusting your Apdex score via your Node.js agent config file (newrelic.js) or the New Relic user interface.
Log files

The Node.js agent writes its log to the newrelic_agent.log file in the application directory, unless you have changed the logging settings. If the agent does not send data or crashes your app, you can generate a troubleshooting log file to accompany bug reports and support requests.

Missing VM metrics

The agent can collect VM metrics related to garbage collection (GC), memory, and CPU. Some of these metrics require an additional native module to be installed.

Here are some common problems and their solutions:


During installation, npm shows one of the following error messages:

gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! build error
gyp ERR! stack Error: not found: make
make: g++: Command not found


Ensure that the prerequisites for the node-gyp module are installed. On Debian/Ubuntu platforms, use this command:

apt-get install build-essential

For more information, see Node.js VM measurements.

Other troubleshooting resources on our Explorers Hub forum:

For more help

If you need more help, check out these support and learning resources: