Title photo
frugal technology, simple living and guerrilla large-appliance repair
Wed, 12 Apr 2017

The Node in the Windows Subsystem for Linux is so old, I installed Node for Windows

I want to run Node, so I figured that I would install the package from the Ubuntu LTS in the Windows Subsystem for Linux and just use it from the Ubuntu commmand line in Windows 10.

But I soon learned that the nodejs in the WSL is v0.10.25. That is hella old. Early 2014 old. No ES6 old.

I don't want to mess with the WSL environment too much, and I have no idea what kinds of binaries from outside the WSL will even work (if any of them will). But I wanted a newer -- a much newer -- Node.

So I installed the Windows version of Node -- the Current version -- which is v7.9.0.

That is a lot newer.

I'm not building major web applications with Node. I'm mostly using it to learn Javascript and even do some traditional scripting that I might otherwise do in Ruby or Bash.

Now I'll be doing that in the Windows command line and not the Windows Subsystem for Linux (until I can no longer hold out without a full, "modern" Linux distribution like Fedora on this laptop).

Update: Node v.0.10.25 in the Ubuntu Trusty LTS is super, super old. For comparison's sake:

Ubuntu Trusty: Node v0.10.25
Ubuntu Xenial (newer LTS): Node v4.2.6
Ubuntu Zesty: Node v.4.7.2
Debian Jessie: Node v0.10.29
Debian Stretch: Node v4.7.2
Debian Sid: Node v4.8.2
Fedora 25 and 26: Node v6.10.2

Even Debian Jessie has a slightly newer nodejs than the Ubuntu LTS in the Windows 10 WSL. There is a way to update the Ubuntu in the WSL from 14.04 to 16.04. Might be worth a look for me.

Update: After a Windows 10 upgrade hosed the laptop, I restored Windows and reinstalled the Windows Subsystem for Linux after that. My user files were preserved, but I lost all of the files I created in the WSL.

Moral of this story: Back up your Linux files. You can back them up in your Windows user files. I would recommend making a habit of using the WSL/Ubuntu command line not in the WSL's traditional /home directory but in your Windows user area. However, things that are complicated (and particularly which involve setting Unix-style permissions) cannot be done successfully on the Windows side. Among these "complicated" things are the use of Unison to sync two filesystems on different computers. The Ubuntu/WSL version of Unison works great in the WSL but throws errors aplenty when used on the Windows side. (One solution is to use the Windows version of Unison, but I'm a whole lot of hacking away from getting ssh working on the Windows command line in a way that Windows Unison finds acceptable; It's not as easy as subbing PuTTY's plink command-line tool.)

My new WSL turned out to be 16.04, not 14.04: This "solved" my Node problem, as I got 4.2.6 instead of 0.10.25, but I also got a newer version of Unison (and had to download, install and "hold" the 14.04 version).

The newer Node in Windows: So I could make better use of Node in Windows, I installed the Windows version of Vim, making sure the console version was included and .bat files were created so I could use Vim to edit files for Node from the Windows command line, which is somewhat of a mystery to me as I've barely used it (and many years ago at that).