vscode-nim
vscode-nim copied to clipboard
Win10 – No 'nim' binary could be found in PATH environment variable
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.
Could you please open "Help"-> "Toggle Developer Tools" and look any errors in console view
extensionService.ts:900 Activating extension 'kosz78.nim' failed: Path must be a string. Received undefined.
w._logMessageInConsole @ extensionService.ts:900
seems to be it
https://github.com/pragmagic/vscode-nim/blob/d708f9b41387aa784c765044704d5d8153e80c90/src/nimUtils.ts#L95
this extension not handle win32
Good, because I'm using 64-bit
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.
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
@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
They are set in the PATH environmentl variable.
sudo ln -s $HOME/.nimble/bin/nim /usr/local/bin/nim
Fixed this issue for me.
That's going to be rather hard, considering
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/
.
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
maybe adding an option for locate nim binaries manually could help, similar extensions for other languages has that option
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.
Workaround: run VSCode on cmd/powershell
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
Sure, I'd love there to be a good LSP server for Nim. Just need someone passionate to create it.
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 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.
maybe VS Code doesn't read your User Path env var? Have you tried echoing the PATH in a VS Code terminal?
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.
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)
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.