Node Development on Ubuntu Bash on Windows 10

The latest version of Ubuntu on Windows works for me for Node development. If you’ve previously installed Node, NPM, webpack, etc on Windows, you will need to replicate this effort in the Ubuntu shell environment.

To get this, you need the following prerequisites:
– Windows 10 anniversary edition (several reboots and a long time, and a lot of disk space)
– Subsequent updates that will also come down – these are necessary to get file system watching to work
– Install the “Linux” feature (beta)
– When you open “bash” it will download bash from the Windows store (prepare to wait)
– Need to reinstall NPM (-g install may require sudo)

To get the latest version of Node, do this:

curl -sL | sudo -E bash -

Then, copy /usr/bin/nodejs to /usr/bin/node (overwriting what’s there, if anything)1

I would also recommend editing ~/.bashrc and add this, to prevent Ubuntu from trying to run the Windows version of npm:

export PATH=/usr/bin:$PATH

If you get an error that says “cannot run in wd” – you are running “npm install” as root. You can add the “–unsafe-perm” argument, or create a new user.

I did some basic verification and found these seem to work:
– vim / top / ps (while ps works, it just shows Ubuntu processes)

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.

  1. []