{"issue":{"pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"state":"closed","user":{"avatar_url":"https://secure.gravatar.com/avatar/ce960d9940df76d53d9132b656ee2e85?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"ce960d9940df76d53d9132b656ee2e85","url":"https://api.github.com/users/robinmattern","login":"robinmattern","id":1158299},"milestone":null,"assignee":{"avatar_url":"https://secure.gravatar.com/avatar/273451b1fabab836e30e633ef4070cf1?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"273451b1fabab836e30e633ef4070cf1","url":"https://api.github.com/users/igorzi","login":"igorzi","id":882901},"updated_at":"2011-11-10T21:39:05Z","labels":[{"name":"windows","color":"0b02e1","url":"https://api.github.com/repos/joyent/node/labels/windows"}],"comments":10,"closed_at":"2011-11-10T21:39:04Z","url":"https://api.github.com/repos/joyent/node/issues/1961","body":"I am new to node.js, so this may not be a legitimate issue, but I noticed that you are removing process.writeError (see #1860).\r\n\r\nThis will break the only way that I could display console messages when I test node,js code using the \"run\" command inside Windows text editors such as TextPad or Komondo.  Console.log() fails in this environment, but console.error() does not in version 0.5.9.    \r\n\r\nI looked at the source for console.error() in version 0.5.9, and I see it uses writeError(), but in version 0.5.10 it uses process.stderr.write().  When I tested this function directly, along with process.stdout.write(), it too fails when run as a batch command from within the two editors I tested.   \r\n\r\nHere is a listing of a script, test.js, that I wrote and the output that I get when I run it within the text editors.  I also ran it in DOS, which works fine, other than the direct call to writeError(), which may be a local, private function. \r\n\r\n--------------------------------------------------------------------------------------------\r\nHere is a test script, E:\\test.js, that reproduces the error  \r\n--------------------------------------------------------------------------------------------\r\n\r\n            console.error( \"\" )\r\n            console.error( \"  console.error( aStr )            // works in editor, works in DOS\" )\r\n               console.log( \"  console.log( aStr )               // fails in editor, works in DOS\" )\r\n process.stdout.write( \"  process.stdout.write( aStr ) // fails in editor, works in DOS\\n\" )\r\n  process.stderr.write( \"  process.stderr.write( aStr ) // fails in editor, works in DOS\\n\" )\r\n                  writeError( \"  writeError( aStr )                 // fails in editor, fails in DOS\\n\" )\r\n\r\n-----------------------------------------------------------------------\r\nIn Editor: node.exe E:\\test.js  // fails on console.log() \r\n-----------------------------------------------------------------------\r\n\r\n console.error( aStr )          // works in editor, works in DOS\r\n\r\nnode.js:203\r\n        throw e; // process.nextTick error, or 'error' event on first tick\r\n              ^\r\nTypeError: Cannot call method 'write' of null\r\n    at Socket.write (net_uv.js:389:31)\r\n    at Object.<anonymous> (E:\\test.js:5:19)\r\n    at Module._compile (module.js:432:26)\r\n    at Object..js (module.js:450:10)\r\n    at Module.load (module.js:351:31)\r\n    at Function._load (module.js:310:12)\r\n    at Array.<anonymous> (module.js:470:10)\r\n    at EventEmitter._tickCallback (node.js:195:26)\r\n\r\n---------------------------------------------------------\r\nI've seen this error, too: \r\n---------------------------------------------------------\r\n\r\nnode.js:203\r\n        throw e; // process.nextTick error, or 'error' event on first tick\r\n              ^\r\nError: write EINVAL\r\n    at errnoException (net_uv.js:569:11)\r\n    at Socket.write (net_uv.js:392:18)\r\n    at Object.<anonymous> (E:\\test.js:5:19)\r\n    at Module._compile (module.js:432:26)\r\n    at Object..js (module.js:450:10)\r\n    at Module.load (module.js:351:31)\r\n    at Function._load (module.js:310:12)\r\n    at Array.<anonymous> (module.js:470:10)\r\n    at EventEmitter._tickCallback (node.js:195:26)\r\n\r\n------------------------------------------------------------------\r\nIn DOS:  node E:\\test.js       // fails on writeError() \r\n-------------------------------------------------------------------\r\n\r\n  console.error( aStr )            // works in editor, works in DOS\r\n  console.log( aStr )               // fails in editor, works in DOS\r\n  process.stdout.write( aStr ) // fails in editor, works in DOS\r\n  process.stderr.write( aStr )  // fails in editor, works in DOS\r\n\r\nnode.js:203\r\n        throw e; // process.nextTick error, or 'error' event on first tick\r\n              ^\r\nReferenceError: writeError is not defined\r\n    at Object.<anonymous> (E:\\test.js:5:19)\r\n    at Module._compile (module.js:432:26)\r\n    at Object..js (module.js:450:10)\r\n    at Module.load (module.js:351:31)\r\n    at Function._load (module.js:310:12)\r\n    at Array.<anonymous> (module.js:470:10)\r\n    at EventEmitter._tickCallback (node.js:195:26)\r\n\r\n\r\n","html_url":"https://github.com/joyent/node/issues/1961","title":"Console.log fails in Windows TextEditors","number":1961,"id":2082058,"created_at":"2011-10-28T17:54:45Z"},"action":"closed"}