{"id":1965,"date":"2016-04-08T15:12:41","date_gmt":"2016-04-08T20:12:41","guid":{"rendered":"http:\/\/bitpost.com\/news\/?p=1965"},"modified":"2016-04-08T15:12:41","modified_gmt":"2016-04-08T20:12:41","slug":"node-debug-lesson-of-the-day","status":"publish","type":"post","link":"https:\/\/bitpost.com\/news\/2016\/node-debug-lesson-of-the-day\/","title":{"rendered":"Node debug lesson of the day"},"content":{"rendered":"<p>Node is fun! \u00a0Except when it&#8217;s not. \u00a0It&#8217;s pretty easy stuff, but I was burned by a couple things today while debugging. \u00a0Take note!<\/p>\n<ul>\n<li>You can &#8211; and MUST, at times &#8211; mess with installed node modules; hack away directly at their source for instantaneous satisfaction!\n<ul>\n<li>find them here:\n<ul>\n<li><strong>linux (always easier):\u00a0<\/strong>~\/.npm<\/li>\n<li><strong>Windows:<\/strong> C:\\Users\\#name#\\AppData\\Roaming\\npm<\/li>\n<\/ul>\n<\/li>\n<li>however, watch out that you follow dependencies properly; if a module requires another, it will often keep a copy\u00a0<strong>underneath<\/strong> its folder; there may also be a\u00a0<strong>global<\/strong> copy in the root npm folder<\/li>\n<\/ul>\n<\/li>\n<li>debugging is most easily accomplished by the good old-fashioned &#8220;jam in print statements&#8221; hacker methodology\n<ul>\n<li>via <strong>console.log(&#8220;WHAT IS HAPPENING!?);<\/strong><\/li>\n<\/ul>\n<\/li>\n<li>when you grow up and want to get into serious debugging, use linux, and sling your code into the Chrome debugger, via <a href=\"https:\/\/github.com\/node-inspector\/node-inspector\">node-inspector<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Node is fun! \u00a0Except when it&#8217;s not. \u00a0It&#8217;s pretty easy stuff, but I was burned by a couple things today while debugging. \u00a0Take note! You can &#8211; and MUST, at times &#8211; mess with installed node modules; hack away directly at their source for instantaneous satisfaction! find them here: linux (always easier):\u00a0~\/.npm Windows: C:\\Users\\#name#\\AppData\\Roaming\\npm however, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[216,19],"tags":[],"class_list":["post-1965","post","type-post","status-publish","format-standard","hentry","category-node-js","category-opensource"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9M11L-vH","jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts\/1965","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/comments?post=1965"}],"version-history":[{"count":1,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts\/1965\/revisions"}],"predecessor-version":[{"id":1966,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts\/1965\/revisions\/1966"}],"wp:attachment":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/media?parent=1965"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/categories?post=1965"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/tags?post=1965"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}