Skip to content

Instantly share code, notes, and snippets.

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

Revisions

  1. @noygal noygal renamed this gist Jan 8, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @noygal noygal revised this gist Oct 30, 2017. 1 changed file with 10 additions and 17 deletions.
    27 changes: 10 additions & 17 deletions instructions.md
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,9 @@
    # Windows 10 Fall Creators Update - Installing Node.js on Windows Subsystem for Linux (WSL)

    Windows just released the [windows subsystem for linux](https://msdn.microsoft.com/en-us/commandline/wsl/about) 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](https://msdn.microsoft.com/en-us/commandline/wsl/faq).
    Windows just released the [windows subsystem for linux](https://msdn.microsoft.com/en-us/commandline/wsl/about) feature to the public with its latest windows fall creator update, if you are not familiar with this feature it allows you to run linux binaries natively on windows - [F.A.Q](https://msdn.microsoft.com/en-us/commandline/wsl/faq).

    ## Enabling WSL
    The feature is not enabled by defualt and you need to activate it, you can do it via powershell (with admin rights):
    The feature is not enabled by default and you need to activate it, you can do it via powershell (with admin rights):
    ```
    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
    ```
    @@ -13,14 +13,14 @@ Now to install your linux version, again two options, you can either install fro
    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.
    For those who are not familiar with linux, fragmentation if part of the fun and there a lot of linux distributions and package management systems for it, the default installation in WSL is ubuntu and I recommend to keep it as it one of the most popular distribution around. If you need different distribution 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`:
    When you first run the command you'll encounter the cli based installer wizard, the ubuntu image will automatically download and you'll be prompt to enter username and password. If you found yourself in need to reset/reinstall the ubuntu machine you can use `lxrun.exe`:
    ```
    CMD> lxrun
    Performs administrative operations on the LX subsystem
    @@ -42,11 +42,11 @@ Usage:

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

    [referernce](https://msdn.microsoft.com/en-us/commandline/wsl/install_guide)
    [reference](https://msdn.microsoft.com/en-us/commandline/wsl/install_guide)

    ## Installing Node.js

    First We'll start by updating linux, for those of you that are not familer with linux this require running the process as `root` by add the `sudo` command before the command we need to execute:
    First We'll start by updating linux, for those of you that are not familiar with linux this require running the process as `root` by add the `sudo` command before the command we need to execute:
    ```
    sudo apt-get update
    sudo apt-get upgrade
    @@ -58,9 +58,9 @@ We also need to install some basic build tool for [node-gyp](https://github.com/
    sudo apt-get install build-essential
    ```

    I do not recommend on the "offical" to install node, node rapid development lifecycle (and the entire ecosystem for that matter) leads more then often for the need to have tight control over the node bineries version, or more likely to have to project running on diffrent versions of node (such as [LTS](https://github.com/nodejs/Release) versions).
    I do not recommend on the "official" to install node, node rapid development life cycle (and the entire ecosystem for that matter) leads more then often for the need to have tight control over the node binaries version, or more likely to have to project running on different versions of node (such as [LTS](https://github.com/nodejs/Release) versions).

    [NVM](https://github.com/creationix/nvm) tool gives you the abilty to install and use multiple version of node, and prevent the (bad) usage of `sudo` for running node application, installation is via the command line:
    [NVM](https://github.com/creationix/nvm) tool gives you the ability to install and use multiple version of node, and prevent the (bad) usage of `sudo` for running node application, installation is via the command line:
    ```
    curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash
    ```
    @@ -72,7 +72,7 @@ nvm install stable
    ```
    To update node just run the command again.

    One thing you'll have to remeber when use NVM is that you'll need to explicitlly specifiy the node version you want to use (installing does it automaticlly on the end of the install), so next time you'll login to ubuntu you'll need to run the command:
    One thing you'll have to remember when use NVM is that you'll need to explicitly specify the node version you want to use (installing does it automatically on the end of the install), so next time you'll login to ubuntu you'll need to run the command:
    ```
    nvm use stable
    ```
    @@ -81,11 +81,4 @@ nvm use stable

    Your windows hard disk drivers are mounted in linux under `/mnt/<drive letter>/` so you can access any folder via linux and run whatever command you need in order to get your project up and running, missing needed tools can be installed via `npm` or `apt-get` for system tools.

    IDE terminal itegration support is still on its early days, [vscode](https://code.visualstudio.com/) offers support with minimal configuration, [guide](https://code.visualstudio.com/docs/editor/integrated-terminal). If your IDE just point to the executible (like cmd.exe) check if you can point it to `c:\Windows\System32\bash.exe`.







    IDE terminal integration support is still on its early days, [vscode](https://code.visualstudio.com/) offers support with minimal configuration, [guide](https://code.visualstudio.com/docs/editor/integrated-terminal). If your IDE just point to the executable (like cmd.exe) check if you can point it to `c:\Windows\System32\bash.exe`.
  3. @noygal noygal revised this gist Oct 30, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion instructions.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Installing Node.js on Windows Subsystem for Linux (WSL)
    # Windows 10 Fall Creators Update - Installing Node.js on Windows Subsystem for Linux (WSL)

    Windows just released the [windows subsystem for linux](https://msdn.microsoft.com/en-us/commandline/wsl/about) 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](https://msdn.microsoft.com/en-us/commandline/wsl/faq).

  4. @noygal noygal revised this gist Oct 17, 2017. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions instructions.md
    Original file line number Diff line number Diff line change
    @@ -53,6 +53,11 @@ sudo apt-get upgrade
    ```
    You'll need to enter your user password to proceed, if you prompt just press y (or yes) to continue.

    We also need to install some basic build tool for [node-gyp](https://github.com/nodejs/node-gyp) - node binaries build tool.
    ```
    sudo apt-get install build-essential
    ```

    I do not recommend on the "offical" to install node, node rapid development lifecycle (and the entire ecosystem for that matter) leads more then often for the need to have tight control over the node bineries version, or more likely to have to project running on diffrent versions of node (such as [LTS](https://github.com/nodejs/Release) versions).

    [NVM](https://github.com/creationix/nvm) tool gives you the abilty to install and use multiple version of node, and prevent the (bad) usage of `sudo` for running node application, installation is via the command line:
  5. @noygal noygal revised this gist Oct 17, 2017. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions instructions.md
    Original file line number Diff line number Diff line change
    @@ -42,6 +42,8 @@ Usage:

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

    [referernce](https://msdn.microsoft.com/en-us/commandline/wsl/install_guide)

    ## Installing Node.js

    First We'll start by updating linux, for those of you that are not familer with linux this require running the process as `root` by add the `sudo` command before the command we need to execute:
  6. @noygal noygal revised this gist Oct 17, 2017. 1 changed file with 37 additions and 1 deletion.
    38 changes: 37 additions & 1 deletion instructions.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # WSL + Node.js
    # Installing Node.js on Windows Subsystem for Linux (WSL)

    Windows just released the [windows subsystem for linux](https://msdn.microsoft.com/en-us/commandline/wsl/about) 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](https://msdn.microsoft.com/en-us/commandline/wsl/faq).

    @@ -42,6 +42,42 @@ Usage:

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

    ## Installing Node.js

    First We'll start by updating linux, for those of you that are not familer with linux this require running the process as `root` by add the `sudo` command before the command we need to execute:
    ```
    sudo apt-get update
    sudo apt-get upgrade
    ```
    You'll need to enter your user password to proceed, if you prompt just press y (or yes) to continue.

    I do not recommend on the "offical" to install node, node rapid development lifecycle (and the entire ecosystem for that matter) leads more then often for the need to have tight control over the node bineries version, or more likely to have to project running on diffrent versions of node (such as [LTS](https://github.com/nodejs/Release) versions).

    [NVM](https://github.com/creationix/nvm) tool gives you the abilty to install and use multiple version of node, and prevent the (bad) usage of `sudo` for running node application, installation is via the command line:
    ```
    curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash
    ```
    Restart your terminal after install.

    Now just install the latest the latest stable version of node:
    ```
    nvm install stable
    ```
    To update node just run the command again.

    One thing you'll have to remeber when use NVM is that you'll need to explicitlly specifiy the node version you want to use (installing does it automaticlly on the end of the install), so next time you'll login to ubuntu you'll need to run the command:
    ```
    nvm use stable
    ```

    ## Developing

    Your windows hard disk drivers are mounted in linux under `/mnt/<drive letter>/` so you can access any folder via linux and run whatever command you need in order to get your project up and running, missing needed tools can be installed via `npm` or `apt-get` for system tools.

    IDE terminal itegration support is still on its early days, [vscode](https://code.visualstudio.com/) offers support with minimal configuration, [guide](https://code.visualstudio.com/docs/editor/integrated-terminal). If your IDE just point to the executible (like cmd.exe) check if you can point it to `c:\Windows\System32\bash.exe`.






  7. @noygal noygal created this gist Oct 17, 2017.
    48 changes: 48 additions & 0 deletions instructions.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,48 @@
    # WSL + Node.js

    Windows just released the [windows subsystem for linux](https://msdn.microsoft.com/en-us/commandline/wsl/about) 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](https://msdn.microsoft.com/en-us/commandline/wsl/faq).

    ## 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!