vscode-nim icon indicating copy to clipboard operation
vscode-nim copied to clipboard

Win10 – No 'nim' binary could be found in PATH environment variable

Open Atulin opened this issue 5 years ago • 23 comments

Plugin version: 0.5.29 VSC version: 1.26.0 Nim version: 0.18.0

Nim is accessible from cmd and VSCode terminal, bin folder added to PATH. Some kind of syntax highlighting is present, but I'm not entirely sure it's correct. Autocompletion and autoindentation do not work at all.

Atulin avatar Aug 17 '18 19:08 Atulin

Could you please open "Help"-> "Toggle Developer Tools" and look any errors in console view

kosz78 avatar Aug 25 '18 05:08 kosz78

extensionService.ts:900 Activating extension 'kosz78.nim' failed: Path must be a string. Received undefined.
w._logMessageInConsole @ extensionService.ts:900

seems to be it

Atulin avatar Aug 25 '18 05:08 Atulin

https://github.com/pragmagic/vscode-nim/blob/d708f9b41387aa784c765044704d5d8153e80c90/src/nimUtils.ts#L95

this extension not handle win32

bung87 avatar Aug 27 '18 19:08 bung87

Good, because I'm using 64-bit image image

Atulin avatar Aug 27 '18 22:08 Atulin

this extension not handle win32

it does: https://github.com/pragmagic/vscode-nim/blob/d708f9b41387aa784c765044704d5d8153e80c90/src/nimUtils.ts#L94 and it works on my machine

The error has to lie somewhere else or the linked implementation doesn't cover some cases

Good, because I'm using 64-bit

afaik win32 is only the name of the standard Windows API which is still in use. It was choosen to differentiate it from the 16-Bit API and nowdays the term win32 is used synonymous with Windows as a developement platform.

RSDuck avatar Aug 28 '18 14:08 RSDuck

yeah,when programming platform defers from 'architecure'

well,this approch is poor,it pretended gets the right path, see issue here: https://github.com/pragmagic/vscode-nim/issues/92

bung87 avatar Aug 28 '18 14:08 bung87

@Atulin it seems you specify nim in user environment, but vscode install in system-wide and it is possible that vscode process run in system environment and dont see user path defines. Could you please try specify nim path in system PATH environment

kosz78 avatar Aug 29 '18 02:08 kosz78

They are set in the PATH environmentl variable.

Atulin avatar Aug 29 '18 03:08 Atulin

sudo ln -s $HOME/.nimble/bin/nim /usr/local/bin/nim Fixed this issue for me.

s0kil avatar Sep 07 '18 23:09 s0kil

That's going to be rather hard, considering image

Atulin avatar Sep 08 '18 01:09 Atulin

Hello, I just installed this extension fresh and am getting this same error, but I'm on Solus (Linux). It says that no nim binary could be found in PATH, and says this: "No 'nim' binary could be found in PATH: '/sbin:/bin:/usr/sbin:/usr/bin:/snap/bin'"

That is not all of my PATH variable:

solarlune@solarlune ~ $ echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/snap/bin:/usr/lib64/golang/bin:/home/solarlune/Tools/Love2D:/home/solarlune/Documents/Projects/Go/bin:/home/solarlune/Tools/Android/platform-tools:/home/solarlune/.nimble/bin

I can run nim or nimble using just that from a command prompt or terminal, from within VSCode or without. Was the PR mentioned above supposed to fix this issue?

EDIT: I was able to fix it by making a symbolic link to the nim executable and placing it in /usr/bin/.

SolarLune avatar Aug 30 '19 17:08 SolarLune

C:\Users\Administrator>nimpretty
[Error] no input file.

C:\Users\Administrator>

But I'm still receiving

No 'nimpretty' binary could be found in PATH environment variable

When I save on VSCode. I don't know what to do, no errors in dev tool console. Win 10, 64-bit. Please help

girng avatar Oct 03 '19 22:10 girng

maybe adding an option for locate nim binaries manually could help, similar extensions for other languages has that option

mrgaturus avatar Oct 23 '19 14:10 mrgaturus

I just installed on a new PC and can also reproduce this.

FWIW to everyone experiencing this issue, as a seasoned Nim developer, I always turn off auto indentation and auto completion for this extension anyway. So it may not be worth fixing this.

Getting auto run of nim check every time you save is nice, but often times misleading (especially for newcomers). I think we really need an official VS Code extension.

dom96 avatar Mar 28 '20 13:03 dom96

Workaround: run VSCode on cmd/powershell

mrgaturus avatar Mar 28 '20 16:03 mrgaturus

I just installed on a new PC and can also reproduce this.

FWIW to everyone experiencing this issue, as a seasoned Nim developer, I always turn off auto indentation and auto completion for this extension anyway. So it may not be worth fixing this.

Getting auto run of nim check every time you save is nice, but often times misleading (especially for newcomers). I think we really need an official VS Code extension.

Why not continue Language Server Protocol?, Not only VSCode benefits, other editors like Vim, emacs and others that supports LSP too

mrgaturus avatar Mar 28 '20 16:03 mrgaturus

Sure, I'd love there to be a good LSP server for Nim. Just need someone passionate to create it.

dom96 avatar Mar 28 '20 17:03 dom96

It seems that this issue has resolved itself, possibly because I restarted my PC. Worth a try if you're suffering from this problem.

dom96 avatar Mar 29 '20 14:03 dom96

I'm still getting this error in 0.6.6. I have nim 1.2.6 installed via scoop and nim.exe is located in my user \scoop\shims directory which is in the User Path environment variable. Restarting didn't help.

geekrelief avatar Aug 28 '20 21:08 geekrelief

maybe VS Code doesn't read your User Path env var? Have you tried echoing the PATH in a VS Code terminal?

dom96 avatar Aug 31 '20 20:08 dom96

The error dialog shows the path it checks and the User Path env var is included. The path to nim in \scoop\shims is included. I followed the suggestions in your earlier reply to disable some options just to get past this.

geekrelief avatar Aug 31 '20 20:08 geekrelief

I'll double check in my Nim port of my extension soon, but I might have inadvertantly fixed the issue and if so can perhaps she'd some light on it.

(fingers crossed)

saem avatar Sep 03 '20 07:09 saem

It seems that this issue has resolved itself, possibly because I restarted my PC. Worth a try if you're suffering from this problem.

I'm a little late to the party. But just to confirm: restarting my Windows 10 desktop fixed the PATH issue in VSCode. Makes sense, you always have to reload Powershell/CMD when adjusting the PATH. The Windows GUI is just another shell.

DePingus avatar Feb 03 '21 00:02 DePingus