Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Gdaimon/8127d1942b3b50a99b27f6351f280f7d to your computer and use it in GitHub Desktop.

Select an option

Save Gdaimon/8127d1942b3b50a99b27f6351f280f7d to your computer and use it in GitHub Desktop.
Installing node via windows subsystem for linux

WSL + Node.js

Windows just released the windows subsystem for linux feature to the public with its latest windows fall creater update, if you are not familier with this feature it allows you to run linux binaries natively on windows - F.A.Q.

Enabling WSL

The feature is not enabled by defualt and you need to activate it, you can do it via powershell (with admin rights):

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Or you can open: Control-Panel -> Programs -> Turn Windows feature on ro off, and click the "windows subsystem for linux (beta)" button.

Now to install your linux version, again two options, you can either install from Windows store (search linux) or you can turn on developer mode and open it via the command line: Open Settings -> Update and Security -> For developers, and Select the "Developer Mode" radio button.

Installing linux (ubuntu)

For those who are not familier with linux, fragmention if part of the fun and there a lot of linux destribtions and package manegment systems for it, the default installation in WSL is ubuntu and I recommend to keep it as it one of the most pupolar destribution around. If you need diffrent destribution the easiest why is to install it from the windows store.

Run CMD.exe and type:

bash

When you first run the command you'll encounter the cli based installer wizard, the ubuntu image will automaticlly download and you'll be prompt to enter username and password. If you found youself in need to reset/reinstall the ubuntu machine you can use lxrun.exe:

CMD> lxrun
Performs administrative operations on the LX subsystem

Usage:
    /install - Installs the subsystem
        Optional arguments:
            /y - Do not prompt user to accept
    /uninstall - Uninstalls the subsystem
        Optional arguments:
            /full - Perform a full uninstall
            /y - Do not prompt user to accept
    /setdefaultuser - Configures the subsystem user that bash will be launched as. If the user does not exist it will be created.
        Optional arguments:
            username - Supply the username
            /y - If username is supplied, do not prompt to create a password
    /update - Updates the subsystem's package index

That's it, you're running ubuntu on windows!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment