Upgrading or Downgrading Deno Versions with DVM
Last updated: February 27th 2025
Introduction
Just like Node.js, Deno, the secure runtime for JavaScript and TypeScript, also evolves rapidly. Sometimes, you might need to work with different Deno versions for different projects. That's where DVM - Deno Version Manager comes to the rescue!
Think of DVM as your personal Deno version control center. It lets you easily install, switch between, and manage multiple Deno versions on your computer. No more juggling installations or worrying about version conflicts!
Why Use DVM?
- Project Compatibility: Some projects might require a specific Deno version. DVM lets you quickly switch to the right version for each project.
- Easy Testing: Want to see if your code works on an older or the latest Deno? DVM makes it a breeze to test across different versions.
- Keep Things Clean: DVM keeps each Deno version separate, preventing conflicts and making your setup organized.
- Global Deno Management: Install Deno once with DVM, and then manage versions globally without messy manual installations.
Getting Started with DVM
Let's get DVM up and running. The installation is straightforward:
For macOS/Linux (using curl):
$ curl -fsSL https://deno.land/x/dvm/install.sh | sh
For macOS/Linux (using wget):
$ wget -qO- https://deno.land/x/dvm/install.sh | sh
For Windows (PowerShell):
$ iex "& { $(irm https://deno.land/x/dvm/install.ps1) }"
After installation, close and reopen your terminal or run:
$ source ~/.dvm/dvm.sh # For bash/zsh
or
$ . $HOME\.dvm\dvm.ps1 # For PowerShell
Basic DVM Commands You'll Use Every Day
Once DVM is installed, here are the commands you'll use most often:
-
Install a Deno Version:
Let's say you want to install Deno version
v1.30.3
. Just run:$ dvm install 1.30.3
DVM will download and install that specific version for you. You can install multiple versions this way!
-
Use a Specific Deno Version:
To switch to and use the Deno version you just installed (or any other installed version), use the
use
command:$ dvm use 1.30.3
Now, when you run
deno --version
, it will showv1.30.3
. DVM makes this version active in your current terminal session. -
List Installed Deno Versions:
Want to see which Deno versions you have installed using DVM? Simple:
$ dvm list
This will show you a list of all the Deno versions managed by DVM on your system.
-
Uninstall a Deno Version:
If you no longer need a specific version, you can easily remove it:
$ dvm uninstall 1.30.3
This will free up space and keep your DVM installation tidy.
-
Using the Latest Deno Version:
If you want to quickly use the latest stable Deno version, you can often just use:
$ dvm use latest
DVM will fetch and use the most recent stable release. (Note: Always double-check if
latest
behaves as expected and refers to stable in DVM documentation).
Conclusion
This article introduced you to DVM - a Deno version manager. Remember to always refer to the official DVM documentation for the most up-to-date and detailed information!
This article was written by Ahmad Adel. Ahmad is a freelance writer and also a backend developer.
Related articles
-
Node.js, Bun.js, and Deno: How JavaScript Runtimes Have Changed
An short article on different javascript runtimes: Node, Bun, and Deno
Last updated: February 5th 2025
-
JavaScript’s event loop vs. PHP’s multi-process model
An article comparing JS's event-loop and PHP's multi-process model
Last updated: February 5th 2025
-
Node.js boilerplate Typescript, Express, Prisma
On creating a modern Express.js API with Typescript
Last updated: February 6th 2025
-
Nodejs: Implementing a Basic Authentication Mechanism
An article on setting up basic authentication with NodeJS
Last updated: February 7th 2025
-
Turning Node.js Multi-Process: Scaling Applications with the Cluster Module
On scaling NodeJS processes with the cluster module...
Last updated: February 9th 2025
-
Building a Scalable Facebook-style Messaging Backend with NodeJS
Steps to build a facebook-style messaging backend with NodeJS
Last updated: February 10th 2025
-
What is PM2 and Why Your Node App Needs it
An article on PM2 - a Node process manager.
Last updated: February 20th 2025
-
Rate Limiting with Redis and Node.js: Under the Hood
Rate-limiting with Redis and NodeJS
Last updated: February 10th 2025