Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to Detect Deno #19

Closed
bfsmith opened this issue May 14, 2020 · 9 comments · Fixed by #55
Closed

Failed to Detect Deno #19

bfsmith opened this issue May 14, 2020 · 9 comments · Fixed by #55

Comments

@bfsmith
Copy link

bfsmith commented May 14, 2020

I'm experiencing the same issue as https://github.com/justjavac/vscode-deno/issues/78; starting a new issue here since this seems to be the location of new development.

Mac Mojave 10.14.6
VS Code 1.45.0
VS Code Deno Extension version 1.27.0
Deno 1.0.0

Environment

$ deno info
DENO_DIR location: "/Users/ME/.deno"
Remote modules cache: "/Users/ME/.deno/deps"
TypeScript compiler cache: "/Users/ME/.deno/gen"
$ deno eval 'console.log(JSON.stringify(Deno.version))'
{"deno":"1.0.0","v8":"8.4.300","typescript":"3.9.2"}
$ env | grep -i deno
DENO_INSTALL=/Users/ME/.deno
DENO_DIR=/Users/ME/.deno
$ which deno
/Users/ME/.deno/bin/deno

I use zsh as my main shell environment.

I tracked the error down to

const { stdout, stderr } = await execa("deno", [
and saw it's using execa. From the execa README.

Unless the shell option is used, no shell interpreter (Bash, cmd.exe, etc.) is used, so shell features such as variables substitution (echo $PATH) are not allowed.

I export DENO_INSTALL and DENO_DIR in my .zshrc file and add it to the path. Perhaps execa isn't finding Deno because it's not in the standard PATH locations?

@justjavac
Copy link
Contributor

I will rewrite the deno executable finder

@yc51
Copy link

yc51 commented May 14, 2020

@justjavac 老兄,windows也提示在$PATH找不到deno,你代码写的在ProgramFiles里面找,windows默认安装路径是%userprofile%\.deno\

@justjavac
Copy link
Contributor

justjavac commented May 14, 2020

@justjavac 老兄,windows也提示在$PATH找不到deno,你代码写的在ProgramFiles里面找,windows默认安装路径是%userprofile%.deno\

💡 please use English, or Google Translate

Windows also prompts that deno cannot be found in $PATH.

@justjavac
Copy link
Contributor

maybe which is a good choice

@bfsmith
Copy link
Author

bfsmith commented May 14, 2020

If I get some time today, I'll try and get the extension running locally and test out which

@bfsmith
Copy link
Author

bfsmith commented May 14, 2020

I was able to fix this without changing the extension by fully restarting VS Code. I think what happened was I had an instance of VS Code open before I installed Deno and set up the PATH to include it. When I opened a new VS Code instance and installed this extension, the new instance didn't rerun my .zshrc file to pick up the new PATH. I'm guessing VS Code sources it once and uses it for all instances (maybe this is Mac specific behavior).

After fully quitting VS Code and opening it back up, the extension was able to find Deno in the path. Getting Deno. intellisense and all. Thanks for your work on this @justjavac!

tl;dr: Make sure deno is on your path and fully quit VS Code, then open it back up and see if it works.

@bfsmith bfsmith closed this as completed May 14, 2020
@justjavac
Copy link
Contributor

Other people have encountered the same problem, so I should fix this problem

@willconant
Copy link

I had the same problem while using the remote-ssh plugin to work on a remote server. In my case, I had connected to the remote before installing deno, so I had to restart the VS Code agent on the remote before the plugin could find it. Restarting my local VS Code had no effect because the remote agent stays running. It should have been obvious, but I didn't think of it until I had a good sleep.

@hossam-magdy
Copy link

hossam-magdy commented May 21, 2020

same problem encountered here too.

In case anyone lands here from google, a workaround is adding this to the end of ~/.zshrc:

[ ! -f "/usr/local/bin/deno" ] && ln -s "$DENO_INSTALL/bin/deno" "/usr/local/bin/deno"

… at least until the extension is fixed, to detect the executable from $DENO_INSTALL

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

Successfully merging a pull request may close this issue.

5 participants