2025-05-25 Deno for FreeBSD
Deno for FreeBSD
One of the topics I would like to focus on in my blog are more modern development environments and tools that are available for the BSDs. Today, I'll briefly talk about Deno.
Deno is a alternate javascript runtime that uses V8 as the engine and the rest of the bits and pieces in Rust. Originally, Deno was written in Go however this issue documents the migration to Rust (which has been complete for quite some time now).
Once nice thing is that Deno is available in the FreeBSD as a package as well as its associated port thanks to the tireless ports maintainers. This makes installation quite trivial.
The package installation boils down to:
# Install as a package
$ pkg install deno
If you have ports ready on your system, something like the following will build the ports for your system. (Warning that this will also build LLVM and Rust which are quite heavy builds).
# Install from ports
$ cd /usr/ports/www/deno
$ make && doas make install
One thing that I found surprising is that if you try to follow the instructions on Deno's website to install from their curl | sh suggestion the install CAN complete on FreeBSD especially if you have something like the following in your /etc/rc.conf
linux_enable=YES
While the installation of the binary is successful. What you will get is the precompiled Linux binary not a FreeBSD one. Getting the downloaded binary to run is an exercise left for another day. Below, is an attempt at an installation and a subsequent (fail to) execute the downloaded binary.
$ curl -fsSL https://deno.land/install.sh | sh
######################################################################## 100.0%
Deno was installed successfully to /home/user/.deno/bin/deno
/home/user/.deno/bin/deno: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by /home/user/.deno/bin/deno)
Run 'deno --help' to get started
Stuck? Join our Discord https://discord.gg/deno
user@quincy:~ $ file /home/user/.deno/bin/deno
/home/user/.deno/bin/deno: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamicuserly linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=456e8074b51c934e06c9e4b81ed6015a2c2ff244, stripped
user@quincy:~ $ /home/user/.deno/bin/deno --version
/home/user/.deno/bin/deno: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by /home/user/.deno/bin/deno)