Skip to content

Instantly share code, notes, and snippets.

@bahamas10
Created August 28, 2012 19:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bahamas10/3503492 to your computer and use it in GitHub Desktop.
Save bahamas10/3503492 to your computer and use it in GitHub Desktop.
figure out what is trying to write to a stream in node
Trace
at WriteStream.process.stdout.write (/Users/dave/dev/node-latest/index.js:4:11)
at Object.exports.log (console.js:25:18)
at Object.keys.forEach.console.(anonymous function) [as log] (/Users/dave/dev/node-latest/node_modules/log-timestamp/index.js:13:14)
at defaultCb (/Users/dave/dev/node-latest/node_modules/npm/lib/npm.js:205:16)
at Conf.done (/Users/dave/dev/node-latest/node_modules/npm/node_modules/npmconf/npmconf.js:218:15)
at Object.oncomplete (fs.js:297:15)
undefined
... and find out the npm module is firing a default callback because I didn't supply one, that logs to stdout.
/**
* overwrite the process.stdout.write function to call console.trace first
*/
var a = process.stdout.write;
process.stdout.write = function() {
console.trace();
a.apply(this, arguments);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment