diff --git a/util.js b/util.js index 6eea657..b438a9c 100644 --- a/util.js +++ b/util.js @@ -106,7 +106,7 @@ exports.deprecate = function(fn, msg) { var debugs = {}; var debugEnvRegex = /^$/; -if (process.env.NODE_DEBUG) { +if (typeof process !== 'undefined' && process.env.NODE_DEBUG) { var debugEnv = process.env.NODE_DEBUG; debugEnv = debugEnv.replace(/[|\\{}()[\]^$+?.]/g, '\\$&') .replace(/\*/g, '.*')