pragmagic / vscode-nim

An extension for VS Code which provides support for the Nim language.
Other
237 stars 37 forks source link

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

Open Atulin opened 5 years ago

Atulin commented 5 years ago

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.

kosz78 commented 5 years ago

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

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

seems to be it

bung87 commented 5 years ago

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

this extension not handle win32

Atulin commented 5 years ago

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

RSDuck commented 5 years ago

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.

bung87 commented 5 years ago

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

kosz78 commented 5 years ago

@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

Atulin commented 5 years ago

They are set in the PATH environmentl variable.

s0kil commented 5 years ago

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

Atulin commented 5 years ago

That's going to be rather hard, considering image

SolarLune commented 4 years ago

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/.

girng commented 4 years ago
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

mrgaturus commented 4 years ago

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

dom96 commented 4 years ago

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.

mrgaturus commented 4 years ago

Workaround: run VSCode on cmd/powershell

mrgaturus commented 4 years ago

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

dom96 commented 4 years ago

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

dom96 commented 4 years ago

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

geekrelief commented 3 years ago

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.

dom96 commented 3 years ago

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

geekrelief commented 3 years ago

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.

saem commented 3 years ago

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)

DePingus commented 3 years ago

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.