{"id":5468,"date":"2017-10-07T23:47:20","date_gmt":"2017-10-07T23:47:20","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=5468"},"modified":"2017-10-07T23:47:20","modified_gmt":"2017-10-07T23:47:20","slug":"node-error-stdout-not-tty-fixed","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/node-error-stdout-not-tty-fixed\/","title":{"rendered":"Node error: stdout is not a tty [Fixed]"},"content":{"rendered":"<p>When you try to pipe output to a file in Windows \/ msysgit or git bash, you may get this error:<\/p>\n<pre lang=\"Bash\">\n$ node cmd.js > retrieve.sh\nstdout is not a tty\n<\/pre>\n<p>Rather than writing to the file via shell, do this:<\/p>\n<pre lang=\"javascript\">\nvar writable = fs.createWriteStream('retrieve.sh', {flags:'w'});\nwritable.write('mkdir -p ' + path + '\\n');\nwritable.write(\n  'curl -o ' + path + entry.id + '.txt \"' + entry.url + '\"\\n'\n);\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Fixing Node error &#8220;stdout is not a tty&#8221;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[9],"tags":[79,301,387,388],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/5468"}],"collection":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/comments?post=5468"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/5468\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=5468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=5468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=5468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}