0

I install docker on my windows 10. after that I get a message that I need to download and install wsl2.

Now, when I run bash command I get wsl bash.

When I try to run node I get an error (node.exe is installed in my windows10):

DESKTOP-BVRDS:/tmp/docker-desktop-root/mnt/host/c/Users/myuser# node
bash: node: command not found

when I run echo $PATH I get output of:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

and not the windows path's. (where the node and other software installed).

How to solve this error? maybe change the default bash? to git bash? (which I don't know how)

Jon Sud
  • 10,211
  • 17
  • 76
  • 174

2 Answers2

0

In Cmder, open settings: Win + Alt + P

  1. Under Startup > Tasks, add a task called {bash} with the following settings:

    Task parameters (set icon):

      For Cmder icon:  /icon "%CMDER_ROOT%\cmder.exe"
      For Git icon: /icon "C:\Program Files (x86)\Git\etc\git.ico"

Commands (open Git's bash shell):

      "C:\Program Files (x86)\Git\bin\sh.exe" -l -new_console:d:%USERPROFILE%
  1. Under Startup, set startup options to Specified name task --> {bash}

Please check below a couple of articles and should solve an issue.

https://gist.github.com/nickautomatic/02ccb76292f7f8d9767e https://gingter.org/2016/11/16/running-windows-10-ubuntu-bash-in-cmder/

nischay goyal
  • 3,206
  • 12
  • 23
  • Its works when I open new tab in cmder. but as default I open cmd tab, and then I run `bash` command in a file script like `npm run deploy` which run `bash deploy.sh`. and then the wsl run instead of git bash. so this is the problem. – Jon Sud May 31 '20 at 07:12
  • I have posted another answer, please have a look once – nischay goyal May 31 '20 at 07:23
0

Please try below:

  1. Open a regular command prompt (win+r then cmd)
  2. Right-click the title bar and select Properties
  3. Deselect "Use legacy console (requires restart)"

Now it should work either by launching the standalone app, or typing bash into a regular cmd window after restarting Command Prompt.

nischay goyal
  • 3,206
  • 12
  • 23
  • I did as you say, but now when I run bash I get error: `Unsupported console settings. In order to use this feature, the legacy console must be disabled.` – Jon Sud May 31 '20 at 07:27
  • As mentioned above, you need to `deselct` the legacy console and then restart the computer – nischay goyal May 31 '20 at 07:27
  • Can you please check this article once, https://www.winhelponline.com/blog/bash-does-not-start-unsupported-console-settings-windows-10/ I am assuming something is wrong the way you done it – nischay goyal May 31 '20 at 07:29
  • And if no success, can you try `lxrun /uninstall /full` and then `lxrun /install` again – nischay goyal May 31 '20 at 07:31
  • I see that still lagacy is checked, so I unchecked it again and restart. now it unchecked and docker say nothing. but when I run `bash` nothing happens. the process say nothing and exit. – Jon Sud May 31 '20 at 07:33