Vscode_deno: could not find deno in path, please install deno

Created on 25 Sep 2020  ·  19Comments  ·  Source: denoland/vscode_deno

I hoped for intellisence on deno commands in .ts files and .js files when installing this extension.

I'm on Ubuntu , gnome

Steps to reproduce

  1. i created a docker container
  2. started container
  3. connected vscode to docker container
  4. inside container switched user, added sudo rights
  5. installed deno with curl according the docs.
  6. updated .bashrc for new user with export path
    7.reload vscode
  7. deno works in terminal
  8. installed deno vscode extension
    10 added .vscode/settings.json to root of project
    {
    "deno.enable": true
    }
  9. added .ts or .js file to project and tried deno. --> no intellisence, only "Could not find 'deno in your $PATH'......." at bottom right of screen

*Allready tried *

  1. reinstalling extension
  2. reinstalling deno under root user
  3. changed settings.json to different locations

tnx for any advice or help

needs info

Most helpful comment

I had the same issue. I resolved it with:

  • sudo ln -s /home/losintikfos/.deno/bin/deno /usr/bin

  • Restart vscode.

All 19 comments

you have to connect vscode after updating the .bashrc

tnx for your help. Maybe i do misunderstand you but I allready reconnected many times again.

  1. started vscode on ubuntu
  2. started docker container from vscode
  3. connected vscode to docker container
  4. inside that vscode i added the extension

If you open a terminal through VS Code in the container, is deno available there?

yes... step 7. from my steps to reproduce

@JSchermers which deno and echo $PATH from the integrated terminal within vscode please...

Hello and thx for your help. When i echo $PATH, this is the result. Deno is in my bash.rc for root

export DENO_INSTALL="/root/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"

root@371b4a54741e:/# echo $PATH
/root/.deno/bin:/root/.vscode-server/bin/93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Everytime i reload the window VSCODE keeps telling deno is not in the PATH

And which deno from the integrated terminal within vscode?

root@371b4a54741e:/# which deno
/root/.deno/bin/deno

I would like to add that this is not isolated to a single user. I am on Pop!_OS 20.04 which is based off the same Ubuntu version.
deno is in path and can be run by any terminal and, in fact, the terminal within vscode itself.

digitalkitsune@pop-os:~/github/oak_websoket_middleware$ which deno
/home/digitalkitsune/.deno/bin//deno

Could I request a interim fix being a option to override to a manually entered path to a Deno Executable?

I would add that just in general as a backup as sometimes you may want to run a specific version of Deno as opposed to the global one and a workspace override would allow for that.

I have the same issue!
My install steps is almost same as JSchermers!

I had the same issue. I resolved it with:

  • sudo ln -s /home/losintikfos/.deno/bin/deno /usr/bin

  • Restart vscode.

Seeing as @losintikfos fix works. (But don't forget to change to your home directory!) I think this may be a issue in vscode-languageserver, possibly L422-L435 in client/src/node/main.ts

If someone who knows how to debug VSCode extensions could verify the path being used that would help. It may be that the ExecutableOptions needs to be set with the cwd or env option. (If I am reading the src correctly, I may not be. Seriously, don't trust me.)

I had the same issue. I resolved it with:

  • sudo ln -s /home/losintikfos/.deno/bin/deno /usr/bin
  • Restart vscode.

Same solution here! Thanks 👍

I have the same issue on macOS. Screenshot is from the VS Code internal terminal.

Screenshot 2021-02-01 at 12 32 14

_Note:_ for me, the workaround is not starting VS Code “normally” (ie. from the /Applications folder or the Launchpad). When I instead navigate to my project directory in the terminal and then start VS Code with code . it works.

Same issue, perhaps related to fish shell
image

Work around for a homebrew installed deno was
sudo ln -s /opt/homebrew/bin/deno /usr/local/bin/

Same problem, I use flatpak vscode. Tried install deno via script and pacman.
vscode terminal:

$ deno --version
deno 1.7.4 (release, x86_64-unknown-linux-gnu)
v8 9.0.123
typescript 4.1.4
echo $PATH
/home/whiteserk/.nvm/versions/node/v12.20.1/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl

This has likely been resolved in the 3.x branch of the extension.

Was this page helpful?
0 / 5 - 0 ratings