Installing Deno via Cargo and other options
By R. S. Doiel, 2024-12-13
I’ve recently needed to install Deno on several Debian flavored Linux
boxes. I wanted to install Deno using the
cargo install --locked deno
command. Notice the
--locked
option, you need that for Deno. This worked for
the recent Ubuntu 22.04 LTS release. I needed alternatives for Ubuntu
20.04 LTS and Raspberry Pi OS.
Using Cargo
Prerequisites:
- Rust (install with Rustup)
- CMake
- Clang, LLVM dev, Clang DEV and the lld (clang) linker
- SQLite3 and LibSQLite3 dev
- pkg config
- libssh dev, libssl dev
The Debian flavors I work with are recent (Dec. 2024) Ubuntu 22.04 LTS release1.
Recently when I was installing Deno 2.1.4 I got errors about building
the flate2
module. I had forgotten to include the
--locked
option in my cargo command. I found this solution
in Deno GitHub issue 9524.
sudo apt install -y build-essential cmake clang libclang-dev llvm-dev lld \
sqlite3 libsqlite3-dev pkg-config libssh-dev libssl-dev
rustup update
cargo install deno --locked
Other options
For Ubuntu 20.04 LTS and Raspberry Pi OS, use
curl -fsSL https://deno.land/install.sh | sh
to
install.
For Windows on ARM64 use
iwr https://deno.land/install.ps1 -useb | iex
.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
On Raspberry Pi OS I added a nice
before calling
cargo
. Without the “nice” it failed after the “spin”
module.
I failed to install Deno this way on Ubuntu 20.04 LTS, just use the cURL + sh script.↩︎