- Open the terminal First, open the Ubuntu terminal using the shortcut
Ctrl + Alt + T. - Install Deno using the curl command Within the terminal, use the curl command to download and install Deno. Enter the following command:
bashcurl -fsSL https://deno.land/x/install/install.sh | sh
This command downloads the installation script from the Deno official website and executes it via shell.
3. Set environment variables After installation, add the Deno installation path to your environment variables so you can run Deno from any location. Typically, the Deno installation script will prompt you to add the following line to your .bashrc or .zshrc file:
bashexport PATH="$HOME/.deno/bin:$PATH"
Open the .bashrc file and add the line above using:
bashnano ~/.bashrc
Then add the export command at the end of the file, save and close it by pressing Ctrl + O, Enter, and Ctrl + X.
4. Apply environment variable changes After modifying .bashrc, reload it to apply the changes:
bashsource ~/.bashrc
- Verify Deno installation After installation, verify the successful installation of Deno by running:
bashdeno --version
If installed correctly, this command will display the Deno version information.
By following these steps, you should be able to successfully install Deno on the Ubuntu system. If you encounter any issues during installation, consult the Deno official documentation or seek help from relevant developer communities.