navi icon indicating copy to clipboard operation
navi copied to clipboard

/usr/bin/bash: line 1: C:ProgramDatachocolateylibnavitoolsnavi.exe: command not found

Open hslima00 opened this issue 1 year ago • 9 comments

Describe the bug Any navi command results in a error in windows 10, installation from scoop.

To Reproduce Steps to reproduce the behavior:

  1. Use winget to install navi from scoop, version 2.23
  2. Open cmd and run navi
  3. Error shown: /usr/bin/bash: line 1: C:ProgramDatachocolateylibnavitoolsnavi.exe: command not found

Expected behavior Normally run navi

Screenshots image image

Versions:

image

hslima00 avatar May 14 '24 22:05 hslima00

Thanks for opening your first issue here! In case you're facing a bug, please update navi to the latest version first. Maybe the bug is already solved! :)

welcome[bot] avatar May 14 '24 22:05 welcome[bot]

It is correct in windows .

If you want use navi in windows, you must create command by yourself.

First, you should create your cheats file. by default,It is %AppData%\navi\cheats\ Then create yourself cheats fold, just like my_cheats,if fold not exist ,create it. the full path is %AppData%\navi\cheats\my_cheats\ Then you can create your first sample cheat file in my_cheats folder. There is my ii.cheats

% ii

# ii open my_cheats path
powershell.exe  'ii "\$env:AppData\navi\cheats\my_cheats"'

Then, run command navi -p C:\Users\{user}\AppData\Roaming\navi\cheats\my_cheats, select ii command.

the -p param is your chaeats folder's real full path.

It will work.

Next time,just run navi command ,your cheats file in my_cheats will include.

wangshuai-007 avatar Jun 09 '24 17:06 wangshuai-007

I have the same problem in PowerShell, but I downloaded the binaries from the release page (not via a package manager).

If I run .\navi.exe repo browse and select a source, cheats will be downloaded, but I still get the same /bin/bash: line 1: C:Toolsnavinavi.exe: command not found as described.

Reyhn3 avatar Jul 15 '24 09:07 Reyhn3

Ah, I solved it. It was hard to find, but it is actually in the documentation.

First, create a config file:

.\navi.exe info config-example > $ENV:AppData\navi\config.yaml

Then, change shell → command from "bash" to "cmd.exe" (as it says in the comment). Done.

Reyhn3 avatar Jul 15 '24 11:07 Reyhn3

In case you want to use bash I described a workaround for this problem in #794 It enables almost all previewing capabilities of navi when using bash on windows

antonkrusche avatar Oct 12 '24 20:10 antonkrusche

Hi @wangshuai-007, is the issue still present in the latest version (2.24.0)? If not, I'm thinking of closing this issue.

alexis-opolka avatar Mar 25 '25 08:03 alexis-opolka

Hi @wangshuai-007, is the issue still present in the latest version (2.24.0)? If not, I'm thinking of closing this issue.

My install type is choco And the choco latest version is 2.23.0

After install navi by navi-v2.24.0-x86_64-pc-windows-gnu.zip and replace in C:\ProgramData\chocolatey\bin\navi.exe it works well. Now, It will display:

Image

exec: "bash" : executable file not found in %PATH%

wangshuai-007 avatar Mar 25 '25 08:03 wangshuai-007

For now, you need to add a manual configuration file, see @Reyhn3's comment:

Ah, I solved it. It was hard to find, but it is actually in the documentation.

First, create a config file:

.\navi.exe info config-example > $ENV:AppData\navi\config.yaml

Then, change shell → command from "bash" to "cmd.exe" (as it says in the comment). Done.

Note that since 2.24.0 you can call powershell instead of cmd as shell.

I think we're going to fix those issues impacting windows in the upcoming weeks/months since it should work by default on Windows.

alexis-opolka avatar Mar 25 '25 08:03 alexis-opolka

@wangshuai-007 Your shell part of the configuration file should look like this:

shell:
  command: powershell

alexis-opolka avatar Mar 31 '25 20:03 alexis-opolka