pragmagic / vscode-nim

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

No 'nim' binary could be found in PATH #46

Closed brechtm closed 7 years ago

brechtm commented 7 years ago

Running on macOS Sierra, on startup of VSCode the Nim plugin reports

No 'nim' binary could be found in PATH: '/usr/local/Cellar/pyenv-virtualenv/1.0.0/shims:/Users/brechtm/.pyenv/shims:/Users/brechtm/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/TeX/texbin:/Users/brechtm/.nimble/bin'

Yet there is a softlink nim in /usr/local/bin:

/usr/local/bin/nim -> ../Cellar/nim/HEAD-d701de5/bin/nim

which points to the Homebrew-provided nim executable. This binary is working fine from the command line.

Manually linking the nim binary to ~/.local/bin/nim using the absolute path /usr/local/Cellar/nim/HEAD-d701de5/bin/nim seems to fix the problem. I think vscode-nim has trouble with the relative link.

mratsim commented 7 years ago

Also affected.

This is extremely annoying as it hides vscode tab bar.

I didn't have the issue before updating vscode-nim today. I can't find any vscode logs to get my previous vscode-nim version but it was around November 2016.

I believe the issue comes from this commit https://github.com/pragmagic/vscode-nim/commit/96351bbc6106cdc33210843e314e5294121202c4#diff-d032f7c0615e0f05c76900f826b3a561 which is the only one related to binary path since July 2016

Edit: Reverting to 0.5.20 fixes the issue

moigagoo commented 7 years ago

Creating the symlik with absolute path didn't fix it for me.

Interestingly enough, I've had issues with PATH not being detected with Hyper, which is another Electron-based app. I'm really guessing here, but maybe it's an Electron issue.

ghost commented 7 years ago

I am a Sierra user and I also had this problem. My installation of Nim was through brew install, and the symlink to Nim was a relative path:

/usr/local/bin/nim -> ../Cellar/nim/0.17.0/bin/nim

I moved the original link... mv /usr/local/bin/nim /usr/local/bin/nim-backup

...and created a new one with an absolute path: ln -s /usr/local/Cellar/nim/0.17.0/bin/nim /usr/local/bin/nim

Now Visual Studio Code doesnt display the popup anymore and things work as expected.

s0kil commented 5 years ago

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

ElectricCoffee commented 1 year ago

I'm also having this issue all these years later. Neither @ghost's nor @s0kil's solutions seem to work for me.