From f17e6f77daad8e65d1ae277fd29245955649f0ce Mon Sep 17 00:00:00 2001 From: Mark Stosberg Date: Wed, 14 Jan 2015 21:37:56 -0500 Subject: [PATCH] Support Node >= 1.0 and io.js. io.js is out now and although it is version 1.0.1, trying to require 'newrelic' with it was crashing: message = "New Relic for Node.js requires a version of Node equal to or\n" + "greater than 0.6.0. Not starting!" There was a bug in a version checking that was only checking that the minor version was less than 6, but was ignoring the major version, so it failed to notice that that 1.0.1 > = 0.6.0. Before and after checking was done by loading the iojs REPL and trying this: var nr = require('./index.js'); This crashes before the change and works after it. Ref: https://iojs.org/ --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index eb6bfee662..bff96d8854 100644 --- a/index.js +++ b/index.js @@ -13,7 +13,9 @@ try { logger.debug("Process was running %s seconds before agent was loaded.", process.uptime()) - if (process.version && process.version.split('.')[1] < 6) { + var major = parseInt(process.version.split('.')[0]); + var minor = process.version.split('.')[1]; + if (process.version && (major === 0) && (minor < 6)) { message = "New Relic for Node.js requires a version of Node equal to or\n" + "greater than 0.6.0. Not starting!"