in this article, i will share with you how to install deno on ubuntu 18.04 and 20.04. deno, the successor of Node.js, is now stable with it’s v1.0 releaseDeno is a simple, modern, and secure runtime for JavaScript and TypeScript that uses V8 and is built in Rust. Here are some of its highlighting features.

  • 1.) Secure by default. No file, network, or environment access (unless explicitly enabled).
  • 2.) Supports TypeScript out of the box.
  • 3.) Ships a single executable (deno).
  • 4.) It has built-in utilities like a dependency inspector (deno info) and a code formatter (deno fmt).
  • 5.) It has a set of reviewed (audited) standard modules that are guaranteed to work with Deno.
  • 6.) Scripts can be bundled into a single javascript file.

Looking at all these features, it was pretty tempting for me to try it out, and now that it’s stable, why not? Let’s jump into it.

Installing Deno on Ubuntu 18.04

I’m using Ubuntu 18.04 as my primary OS and I have got Homebrew installed on it. So, I’ve tried installing Deno using it first using Homebrew…

brew install deno

But unfortunately, I ended up with the following error which is an existing issue with Homebrew itself.

deno: macOS is required.
Error: An unsatisfied requirement failed this build.

So, I had to switch to another way which was using curl. I ran the following commands.

cd ~
curl -fsSL https://deno.land/x/install/install.sh | sh

And that has successfully installed Deno…

Harsukh21@dell:~$ curl -fsSL https://deno.land/x/install/install.sh | sh
######################################################################## 100.0%
Archive:  /home/dell/.deno/bin/deno.zip
  inflating: deno                    
Deno was installed successfully to /home/dell/.deno/bin/deno
Manually add the directory to your $HOME/.bash_profile (or similar)
  export DENO_INSTALL="/home/dell/.deno"
  export PATH="$DENO_INSTALL/bin:$PATH"
Run '/home/dell/.deno/bin/deno --help' to get started
Harsukh21@dell:~$ 

But there was still some work left. The issue was if I try to get info using command deno --version, nothing came. It was because, I haven’t specified Deno’s install path into the terminal’s .bashrc (or .bash_profile in some other Linux flavors).

So, I added following lines into .bashrc (which was there in the home in my case),

export DENO_INSTALL="/home/dell/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"

I saved it, restarted the terminal, and ran deno --version and boom… it has started working like a charm!

Harsukh21@dell:~$ deno --version
deno 1.0.0
v8 8.4.300
typescript 3.9.2

i hope you like this article.


Was this article helpful?

0 out of 0 person found this article helpful.

Leave a comment

OR

No Comments