0
0
DenoHow-ToBeginner ยท 3 min read

How to Install Deno: Simple Steps for Beginners

To install deno, use the official install script by running curl -fsSL https://deno.land/install.sh | sh on macOS/Linux or use iwr https://deno.land/install.ps1 -useb | iex in PowerShell on Windows. Alternatively, you can install via package managers like brew on macOS or scoop on Windows.
๐Ÿ“

Syntax

The main way to install Deno is by running the official install script in your terminal or command prompt.

  • curl -fsSL https://deno.land/install.sh | sh: Downloads and runs the install script on macOS or Linux.
  • iwr https://deno.land/install.ps1 -useb | iex: Runs the install script in PowerShell on Windows.
  • Package managers like brew install deno (macOS) or scoop install deno (Windows) can also be used.
bash
curl -fsSL https://deno.land/install.sh | sh
๐Ÿ’ป

Example

This example shows how to install Deno on macOS or Linux using the official script, then check the installed version.

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

# After installation, add Deno to your PATH by running:
export DENO_INSTALL="$HOME/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"

# Verify installation:
deno --version
Output
deno 1.35.4 v8 10.9.194.5 typescript 5.1.3
โš ๏ธ

Common Pitfalls

Common mistakes when installing Deno include:

  • Not adding Deno to your system PATH, so the deno command is not found.
  • Running the Linux/macOS script on Windows or vice versa.
  • Using outdated package managers that install old Deno versions.

Always follow the official instructions for your operating system and verify the version after installation.

powershell
## Wrong: Running Linux script on Windows PowerShell
curl -fsSL https://deno.land/install.sh | sh

## Right: Use PowerShell script on Windows
powershell -Command "iwr https://deno.land/install.ps1 -useb | iex"
๐Ÿ“Š

Quick Reference

PlatformInstall CommandNotes
macOS/Linuxcurl -fsSL https://deno.land/install.sh | shOfficial install script
Windows (PowerShell)iwr https://deno.land/install.ps1 -useb | iexOfficial PowerShell script
macOS (Homebrew)brew install denoAlternative package manager
Windows (Scoop)scoop install denoAlternative package manager
โœ…

Key Takeaways

Use the official install script for your operating system to install Deno safely.
Remember to add Deno to your system PATH after installation to run it from the terminal.
Verify your installation by running 'deno --version' to check the installed version.
Avoid mixing install scripts between Windows and macOS/Linux to prevent errors.
Package managers like Homebrew and Scoop offer easy alternative installation methods.