Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

New Relic for Node.js was unable to bootstrap itself


#1

Node Agent Question Template

I’m trying to setup newrelic for a node server running inside a docker.
I’m unable to find any relevant posts, kindly help.

  • Please provide a permalink so our experts can see into the exact time and place as you:

  • What language agent version are you using? Any other relevant versions? (Node modules, etc.?)
    Node v8.11.0

  • If you are seeing an error message, paste in the error message you are seeing (text or screenshot):

    New Relic for Node.js was unable to bootstrap itself due to an error:",“stack”:“TypeError: Cannot read property ‘enabled’ of undefined\n at new Agent (/var/node/quikr-pwa/node_modules/newrelic/lib/agent.js:61:30)\n at createAgent (/var/node/quikr-pwa/node_modules/newrelic/index.js:121:15)\n at initialize (/var/node/quikr-pwa/node_modules/newrelic/index.js:75:15)\n at Object. (/var/node/quikr-pwa/node_modules/newrelic/index.js:32:3)\n at Module._compile (module.js:635:30)\n at Object.Module._extensions…js (module.js:646:10)\n at Module.load (module.js:554:32)\n at tryModuleLoad (module.js:497:12)\n at Function.Module._load (module.js:489:3)\n at Module.require (module.js:579:17)”,“message”:"Cannot read property ‘enabled’ of undefined

  • Describe what are you seeing? Describe how that differs from you were expecting to see?
    Unable to start the newrelic agent


#2

Hi @harshit.kumar, I see you you have a ticket open for this issue, it would be great to post your solution back in here when you get it :smiley:


#3

Hi @rdouglas,
We added the below node script to fix the error.

let fs = require(‘fs’);

let fileContent = fs.readFileSync(’./node_modules/newrelic/index.js’, { encoding: ‘utf-8’ });

fileContent = fileContent.replace(“lib/config’”, “lib/config/index’”);

fs.writeFileSync(’./node_modules/newrelic/index.js’, fileContent, { encoding: ‘utf-8’, flag: ‘w’ });


#4

Glad to hear it, great work :smiley: