'executing file_server giving error after install, when deno is already installed and executes without any error

I installed deno and have been practicing successfully while going through the manual.

But as soon as I did the steps as outlined in the examples of File Server, after I have installed and executed ...

$ file_server .
~/.deno/bin/file_server: 3: exec: deno: not found

I have file_server in the bin of deno...

$ ls -al ~/.deno/bin/
total 86668
drwxr-xr-x 2 ***** *****     4096 Feb 10 23:53 .
drwxr-xr-x 3 ***** *****     4096 Feb  9 15:34 ..
-rwxr-xr-x 1 ***** ***** 88735456 Feb  4 05:48 deno
-rwxr-xr-x 1 ***** *****      134 Feb 10 23:53 file_server

My .bashrc has...

export DENO_INSTALL="~/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
. "$HOME/.cargo/env"

deno executes fine...

$ deno
Deno 1.18.2
exit using ctrl+d or close()
> 1+ 2
3
> 

file_server content...

#!/bin/sh
# generated by deno install
exec deno run --allow-read --allow-net 'https://deno.land/[email protected]/http/file_server.ts' "$@"

uname -a...

$ uname -a
Linux ranjan-t410 4.19.0-17-amd64 #1 SMP Debian 4.19.194-3 (2021-07-18) x86_64 GNU/Linux

Results of which command...

:~$ which deno
:~$ which file_server
:~$

deno version...

$ deno --version
deno 1.18.2 (release, x86_64-unknown-linux-gnu)
v8 9.8.177.6
typescript 4.5.2

All other examples I have been able to deno run until this one.

What is it that I haven't done properly, or have I missed anything?



Few Observations on my computer

  1. which command return(s) empty for both deno and file_server
  2. $ ls -al /usr/bin/sh

    lrwxrwxrwx 1 root root 4 Sep 16 2020 /usr/bin/sh -> dash

  3. If I change the shebang in file_server file from #!/bin/sh to #!/bin/bash, then it works...


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source