Parth Kharecha
Parth Kharecha

Reputation: 6503

How to Install Deno on Ubuntu

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?

Upvotes: 15

Views: 10474

Answers (8)

Ahmed Mahmoud
Ahmed Mahmoud

Reputation: 1832

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

Upvotes: 21

Hoang Subin
Hoang Subin

Reputation: 7420

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.

Upvotes: 0

Mejan
Mejan

Reputation: 1276

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

Upvotes: 0

Parth Kharecha
Parth Kharecha

Reputation: 6503

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

Upvotes: 6

Abhishek Khatter
Abhishek Khatter

Reputation: 75

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

Upvotes: 3

user9573798
user9573798

Reputation:

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

Upvotes: 2

Marcos Casagrande
Marcos Casagrande

Reputation: 40434

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

Upvotes: 3

ROOT
ROOT

Reputation: 11622

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)

Upvotes: 3

Related Questions