After installing npm on WSL Ubuntu 20.04 I get the message “/usr/bin/env: ‘bash\r’: No such file or directory”

This may be a line endings issue, but not from Ubuntu. Make sure you have node and npm installed correctly: From WSL run sudo apt install nodejs npm to install node & npm From PowerShell/CMD run wsl –shutdown to restart the WSL service Next in WSL run which npm to confirm it’s installed [output: /usr/bin/npm] … Read more

How to enable Bash in Windows 10 developer preview?

To enable bash in Windows 10: Click the Start button , click Control Panel, click Programs, and then click Turn Windows features on or off. Enable Windows Subsystem for Linux To get Bash installed, open Command Prompt and type “bash” For More Information visit : Announcing Windows 10 Insider Preview Build 14316 Run Bash on … Read more

How to remove the Win10’s PATH from WSL

For Windows builds HIGHER than 17713: WSL uses the file /etc/wsl.conf inside each Linux VM’s filesystem to configure its behavior. Add the following configuration settings (explained here) to /etc/wsl.conf, creating that file if necessary: [interop] appendWindowsPath = false Note that appendWindowsPath must be under [interop] for this to work. You may need to shutdown the … Read more

Running graphical Linux desktop applications from WSL 2 – “Error E233: cannot open display” [closed]

The networking subsystem in WSL2 is different than the used in WSL1. You must consider the differences to access networking apps running on Windows and on Linux: In WSL1, Linux uses the same IP addresses than the Windows host, then, you can access the applications using localhost or 127.0.0.1 In WSL2, Linux runs on a … Read more

Why am I getting a “Cannot connect to the Docker daemon” error in WSL2?

I know this may be outdated for the present question, but this should save us precious time, especially when Windows 20H1=2004 is going to Production this month (May 2020).   Operating System Version: Windows 10 Education (Same as Enterprise and a superset of Pro).   Version: 2004   Build (Version OS): 19041.264   Others: Windows Feature Experience Pack 120.2202.130.0. … Read more

How to use WSL as default terminal in WebStorm or any other JetBrains’ products?

After a bit of search on google found a solution to my question. First figure out the default wsl with the command: C:\Windows\System32\wslconfig /list Windows Subsystem for Linux Distributions: Ubuntu-18.04 Legacy (Default) then I set the default to Ubuntu-18.04 by C:\Windows\System32\wslconfig /setdefault Ubuntu-18.04 Finally set the terminal path in Webstrom settings>tools>terminal to C:\Windows\System32\wsl.exe Now open … Read more

Why is WSL extremely slow when compared with native Windows NPM/Yarn processing?

Since you mention executing the same files (with proper performance) from within Git Bash, I’m going to make an assumption here. Correct me if I’m wrong on this, and I’ll delete the answer and look for another possibility. This would be explained (and expected) if your files are stored on /mnt/c (a.k.a. C:, or /C … Read more

Docker not running on Ubuntu WSL due to error cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? [closed]

Using WSL2 You simply have to activate and use WSL2, I have to install Ubuntu 20.04 as the 18.04 wasn’t connecting with Docker desktop. In the windows shell: To check the WSL mode, run wsl -l -v To upgrade your existing Linux distro to v2, run: wsl –set-version (distro name) 2 WSL Integration will be … Read more