Recommended way of installing deno 'virtually' (not globally)
Hey guys, following some tutorials to get started with Deno! All of them install deno globally... isn't there a way to keep a deno install 'local' per project? Couldn't find the answer yet, any help appreciated.
3 Replies
Not sure if there is something like
nvm
for Deno. We take backwards compatibility very seriously and only made breaking changes once in the Deno 1 -> 2 transition. For that reason most people always run the latest version.I created a VSCODE devcontainer - super easy to use if you have docker installed…
https://github.com/DenoBlox/devcontainer
GitHub
GitHub - DenoBlox/devcontainer: This repository contains a template...
This repository contains a template VSCODE devcontainer for Deno with common useful VSCODE extensions. - DenoBlox/devcontainer
I'm surprised nobody mentioned this, but there are two official ways.
1. I personally don't like asdf, but asdf-deno is supported and has auto-activation of local deno per-project. https://github.com/asdf-community/asdf-deno
2. Doing it manually is easy.
- Set DENO_INSTALL to somewhere in your project. Ex:
export DENO_INSTALL=$HOME/repos/project1/.deno
- run the normal deno install command with the version you want: ex: curl -fsSL https://deno.land/install.sh | sh -s v1.0.0
- then set your path to include the bin folder. Ex; export PATH="$HOME/repos/project1/.deno/bin:$PATH"
- You can use a tool like dotenv to activate the path automatically when you enter that project directoryGitHub
GitHub - asdf-community/asdf-deno: Deno plugin for the asdf version...
Deno plugin for the asdf version manager [maintainer=LOOKING FOR A MAINTAINER! SUBMIT A PULL REQUEST TO THE INFRASTRUCTURE REPOSITORY!] - asdf-community/asdf-deno