{"id":5201,"date":"2016-11-21T18:20:14","date_gmt":"2016-11-21T18:20:14","guid":{"rendered":"http:\/\/www.garysieling.com\/blog\/?p=5201"},"modified":"2016-11-21T18:20:14","modified_gmt":"2016-11-21T18:20:14","slug":"node-development-ubuntu-bash-windows-10","status":"publish","type":"post","link":"https:\/\/www.garysieling.com\/blog\/node-development-ubuntu-bash-windows-10\/","title":{"rendered":"Node Development on Ubuntu Bash on Windows 10"},"content":{"rendered":"<p>The latest version of Ubuntu on Windows works for me for Node development. If you&#8217;ve previously installed Node, NPM, webpack, etc on Windows, you will need to replicate this effort in the Ubuntu shell environment.<\/p>\n<p>To get this, you need the following prerequisites:<br \/>\n&#8211; Windows 10 anniversary edition (several reboots and a long time, and a lot of disk space)<br \/>\n&#8211; Subsequent updates that will also come down &#8211; these are necessary to get file system watching to work<br \/>\n&#8211; Install the &#8220;Linux&#8221; feature (beta)<br \/>\n&#8211; When you open &#8220;bash&#8221; it will download bash from the Windows store (prepare to wait)<br \/>\n&#8211; Need to reinstall NPM  (-g install may require sudo)<\/p>\n<p>To get the latest version of Node, do this:<\/p>\n<pre lang=\"bash\">\ncurl -sL https:\/\/deb.nodesource.com\/setup_6.x | sudo -E bash -\n<\/pre>\n<p>Then, copy \/usr\/bin\/nodejs to \/usr\/bin\/node (overwriting what&#8217;s there, if anything)<sup><a href=\"#footnote_0_5201\" id=\"identifier_0_5201\" class=\"footnote-link footnote-identifier-link\" title=\"https:\/\/aigeec.com\/installing-node-js-on-windows-10-bash\/\">1<\/a><\/sup><\/p>\n<p>I would also recommend editing ~\/.bashrc and add this, to prevent Ubuntu from trying to run the Windows version of npm:<\/p>\n<pre lang=\"bash\">\nexport PATH=\/usr\/bin:$PATH\n<\/pre>\n<p>If you get an error that says &#8220;cannot run in wd&#8221; &#8211; you are running &#8220;npm install&#8221; as root. You can add the &#8220;&#8211;unsafe-perm&#8221; argument, or create a new user.<\/p>\n<p>I did some basic verification and found these seem to work:<br \/>\n&#8211; vim \/ top \/ ps (while ps works, it just shows Ubuntu processes)<\/p>\n<p>If you checked out a git repository previously, you likely will not want to share this between Ubuntu and Windows, as the line endings will differ.<\/p>\n<ol class=\"footnotes\"><li id=\"footnote_0_5201\" class=\"footnote\">https:\/\/aigeec.com\/installing-node-js-on-windows-10-bash\/<span class=\"footnote-back-link-wrapper\"> [<a href=\"#identifier_0_5201\" class=\"footnote-link footnote-back-link\">&#8617;<\/a>]<\/span><\/li><\/ol>","protected":false},"excerpt":{"rendered":"<p>Testing Node.js development on Ubuntu for Windows<\/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":[4],"tags":[302,559,597],"aioseo_notices":[],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/5201"}],"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=5201"}],"version-history":[{"count":0,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/posts\/5201\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/media?parent=5201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/categories?post=5201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.garysieling.com\/blog\/wp-json\/wp\/v2\/tags?post=5201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}