How to Install Deno on Ubuntu
Asked Answered
A

8

15

The command I run is:

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

The output is:

######################################################################## 100.0%
Archive:  /root/.deno/bin/deno.zip
  inflating: deno
Deno was installed successfully to /root/.deno/bin/deno
Manually add the directory to your $HOME/.bash_profile (or similar)
  export DENO_INSTALL="/root/.deno"
  export PATH="$DENO_INSTALL/bin:$PATH"
Run '/root/.deno/bin/deno --help' to get started

After this, I run deno in the terminal and it gives me an error.

Can anyone explain how to install Deno in Ubuntu properly?

Altogether answered 17/5, 2020 at 12:26 Comment(0)
A
6

Open your terminal and run this

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

username: open termianla and run whoami

Now set path in .bashrc file

run nano .bashrc for open file and put below code with replacing with username

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

finally run the following command source ~/.bashrc

now run deno in your terminal

Altogether answered 17/6, 2020 at 12:43 Comment(1)
Perfect answer. Thank you.Middlebrow
R
21

Installing Deno by running the following command from it's official website

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

After installing it update .bashrc file in your profile directory:

sudo nano ~/.bashrc

then add these two lines in the file

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

you can get this two lines from the message you get after installing deno after

finally run the following command source ~/.bashrc

after that run deno by typing this command in terminal deno

This video explain the installation process in details Installing deno on ubuntu

Rhona answered 12/6, 2020 at 22:15 Comment(1)
This works great, except that the command to edit the file should be sudo nano ~/.bashrc since you could easily be in a directory other than ~Avocet
A
6

Open your terminal and run this

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

username: open termianla and run whoami

Now set path in .bashrc file

run nano .bashrc for open file and put below code with replacing with username

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

finally run the following command source ~/.bashrc

now run deno in your terminal

Altogether answered 17/6, 2020 at 12:43 Comment(1)
Perfect answer. Thank you.Middlebrow
F
3

The installer already telling you what to do after installation is finished:

Manually add the directory to your $HOME/.bash_profile (or similar)
export DENO_INSTALL="/root/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"


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

You can just run the two lines in the terminal directly to start using it in your current terminal or just edit and add them to $HOME/.bashrc or $HOME/.bash_profile (or similar)

Fabrikoid answered 17/5, 2020 at 12:31 Comment(1)
The installer tells you to run commands that will make it SEEM like Deno is installed. However, whenever you start a new shell, you lose the modified PATH variable.Avocet
T
3

You have to add the following commands after the installation to your bash profile. Usually ~/.bashrc or ~./bash_profile

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

(please have in mind that the above commands may change, so always use the values you got from the installation output)

As you can see in the output of the installation:

Deno was installed successfully to /root/.deno/bin/deno.

Manually add the directory to your $HOME/.bash_profile (or similar)

Once you have added those two lines you can start a new terminal, or just load your bash profile using source command

source ~/.bashrc
# or source ~/.bash_profile

If you want to install a specific version you can do so adding: -s {version} to that command:

curl -fsSL https://deno.land/x/install/install.sh | sh -s v0.42.0
Teets answered 17/5, 2020 at 12:37 Comment(5)
The root was /home/$USER/ in my case.Banda
You're right, I added a note regarding that, since I used OP values.Teets
Is it .bashrc, or .bashprofile? The installer is giving us ambiguous instructions and I think people want clarification, not more choices to make.Avocet
Both files can be used. I think people need to know all options. As a Linux user you know which bash profile you're using anyways.Teets
It's good to note both options, but only someone who has messed with their Bash settings recently would know which one they're using. Anyone who is just using the Ubuntu defaults (or who hasn't touched them recently) would not know. The default on Ubuntu 20 is ~/.bashrc, for the record.Avocet
P
3

I was also facing the same issue but below command worked for me:

curl -fsSL https://deno.land/x/install/install.sh | sudo DENO_INSTALL=/usr/local sh
Prasad answered 2/6, 2020 at 17:19 Comment(0)
R
2

You have to configure globally in ubuntu system. So first of all ,

nano ~/.bashrc
Edit the .bashrc file and add this below code
export DENO_INSTALL="/root/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"

Then just source bashrc file.

source ~/.bashrc
Renfrew answered 18/5, 2020 at 9:17 Comment(0)
I
0

You have to add the scripts in your bashrc profile.

Open the bashrc file with any command below and add the scripts at the end of the file. After saving the file, restart your terminal.

# for gedit text editor
gedit ~/.bashrc
# or for GNU nano editor
nano ~/.bashrc
# deno
export DENO_INSTALL="/home/YOUR_USERNAME/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"

Full explanation with details: How to install Deno on Windows, Mac, and Linux Operating Systems

Inhambane answered 5/9, 2020 at 12:14 Comment(0)
I
0

You just follow the command line

######################################################################## 100.0%
Archive:  /root/.deno/bin/deno.zip
  inflating: deno
Deno was installed successfully to /root/.deno/bin/deno
Manually add the directory to your $HOME/.bash_profile (or similar)
  export DENO_INSTALL="/root/.deno"
  export PATH="$DENO_INSTALL/bin:$PATH"
Run '/root/.deno/bin/deno --help' to get started

It tell you that you need to go to $HOME/.bash_profile or similar one to add this configuration.

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

Here is how to add it step by step

  1. sudo nano ~/.bash_profile or sudo nano ~/.bashrc (I use this because my OS is Ubuntu)
  2. Copy this line into that file
export DENO_INSTALL="/root/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"

Note: for those who are using Ubuntu, it is a little bit different.

export DENO_INSTALL="/$HOME/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
  1. Store
  • CTRL + O and Enter to save.
  • CTRL + X to close the file.
  1. Close the terminal, open again and type deno --version to check.
Intuition answered 19/1, 2021 at 4:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.