Skip to content
This repository has been archived by the owner on Jan 3, 2025. It is now read-only.

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

Open
Atulin opened this issue Aug 17, 2018 · 23 comments
Open

Comments

@Atulin
Copy link

Atulin commented Aug 17, 2018

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
Copy link
Collaborator

kosz78 commented Aug 25, 2018

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

@Atulin
Copy link
Author

Atulin commented Aug 25, 2018

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
Copy link

bung87 commented Aug 27, 2018

if (process.platform !== 'win32') {

this extension not handle win32

@Atulin
Copy link
Author

Atulin commented Aug 27, 2018

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

@RSDuck
Copy link
Contributor

RSDuck commented Aug 28, 2018

this extension not handle win32

it does:

_pathesCache[tool] = pathparts.map(dir => path.join(dir, correctBinname(tool))).filter(candidate => fs.existsSync(candidate))[0];
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
Copy link

bung87 commented Aug 28, 2018

yeah,when programming platform defers from 'architecure'

well,this approch is poor,it pretended gets the right path, see issue here: #92

@kosz78
Copy link
Collaborator

kosz78 commented Aug 29, 2018

@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
Copy link
Author

Atulin commented Aug 29, 2018

They are set in the PATH environmentl variable.

@s0kil
Copy link

s0kil commented Sep 7, 2018

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

@Atulin
Copy link
Author

Atulin commented Sep 8, 2018

That's going to be rather hard, considering
image

@SolarLune
Copy link

SolarLune commented Aug 30, 2019

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
Copy link

girng commented Oct 3, 2019

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
Copy link

mrgaturus commented Oct 23, 2019

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

@dom96
Copy link

dom96 commented Mar 28, 2020

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
Copy link

Workaround: run VSCode on cmd/powershell

@mrgaturus
Copy link

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
Copy link

dom96 commented Mar 28, 2020

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

@dom96
Copy link

dom96 commented Mar 29, 2020

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
Copy link

geekrelief commented Aug 28, 2020

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
Copy link

dom96 commented Aug 31, 2020

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

@geekrelief
Copy link

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
Copy link

saem commented Sep 3, 2020

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
Copy link

DePingus commented Feb 3, 2021

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests