GithubHelp home page GithubHelp logo

justjavac / dvm Goto Github PK

View Code? Open in Web Editor NEW
619.0 9.0 36.0 783 KB

๐Ÿฆ• Deno Version Manager - Easy way to manage multiple active deno versions.

Home Page: https://dvm.deno.dev

License: MIT License

PowerShell 1.83% Shell 2.33% Rust 95.02% TypeScript 0.81%
deno runtime version typescript v8 dvm package-manager

dvm's Introduction

dvm

English | ็ฎ€ไฝ“ไธญๆ–‡

Installation

You can install it using the installers below, or download a release binary from the releases page.

With Shell:

curl -fsSL https://dvm.deno.dev | sh

With PowerShell:

irm https://dvm.deno.dev | iex

Usage

โžœ  ~  dvm --help
Deno Version Manager - Easy way to manage multiple active deno versions.

Usage: dvm.exe <COMMAND>

Commands:
  completions  Generate shell completions
  info         Show dvm info.
  install      Install deno executable to the given version. [aliases: i, add]
  list         List all installed versions [aliases: ls, ll, la]
  list-remote  List all released versions [aliases: lr, ls-remote]
  uninstall    Uninstall a given version [aliases: un, unlink, rm, remove]
  use          Use a given version or a semver range or a alias to the range.
  alias        Set or unset an alias
  activate     Activate Dvm
  deactivate   Deactivate Dvm
  doctor       Fixing dvm specific environment variables and other issues
  upgrade      Upgrade aliases to the latest version, use `self` to upgrade dvm itself
  exec         Execute deno command with a specific deno version
  clean        Clean dvm cache
  registry     Change registry that dvm fetch from
  update       Update remove version list local cache to the latest
  help         Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help information
  -V, --version  Print version information

EXAMPLE:
  dvm install 1.3.2     Install v1.3.2 release
  dvm install           Install the latest available version
  dvm use 1.0.0         Use v1.0.0 release
  dvm use latest        Use the latest alias that comes with dvm, equivalent to *
  dvm use canary        Use the canary version of the Deno

NOTE:
  To remove, delete, or uninstall dvm - just remove the `$DVM_DIR` folder (usually `~/.dvm`)

Verify installation

To verify that dvm has been installed, do:

dvm -V

which should output dvm's version if the installation was successful.

Initialisation

Calling dvm will creates an ~/.dvm/ directory if it doesn't exist, and all installed versions of deno will put into ~/.dvm.

โžœ  ~  dvm
Creating /Users/justjavac/.dvm

.dvmrc

You can let dvm to writing config to current directery by add the --local flag to dvm use. Afterwards, dvm use, dvm install will use the version specified in the .dvmrc file if no version is supplied on the command line.

For example, to make dvm default to the 1.17.0 release for the current directory:

dvm use --local 1.17.0

Then when someone else with a copy of your project and run dvm:

$ dvm use
No version input detect, try to use version in .dvmrc file
Using semver range: 1.17.0
Writing to home folder config
Now using deno 1.17.0

Example

Listing versions

List all installed versions:

โžœ  ~  dvm list
 * 0.1.0
   0.1.1
   0.1.2

The version with a asterisk(*) means that this version is the version currently in use.

Switching version

โžœ  ~  dvm use 1.1.0
now use deno 1.1.0
โžœ  ~  dvm use 1.2.0
deno v1.2.0 is not installed. Use `dvm install 1.2.0` to install it first.

Compatibility

Caveats

unzip is required

The program unzip is a requirement for the Shell installer.

$ curl -fsSL https://deno.land/x/dvm/install.sh | sh
Error: unzip is required to install dvm (see: https://github.com/justjavac/dvm#unzip-is-required).

When does this issue occur?

During the install.sh process, unzip is used to extract the zip archive.

How can this issue be fixed?

You can install unzip via brew install unzip on MacOS or apt-get install unzip -y on Linux(Ubuntu,Debian,Deepin).

Powershell on Windows is required

Currently, we use PowerShell profile to set environment variables due to various reasons, so it's required.

License

Deno Version Manager(dvm) is released under the MIT License. See the bundled LICENSE file for details.

dvm's People

Contributors

alexdohmen avatar cgqaq avatar chawyehsu avatar chinanf-boy avatar code-ape avatar dependabot[bot] avatar eliezerspp avatar hylarucoder avatar jinchaofs avatar jkochis avatar justjavac avatar krymtkts avatar liruifengv avatar njugray avatar noah19846 avatar programmarchy avatar pythys avatar qiuquanwu avatar so1ve avatar wangziling avatar weilet avatar zhu-xiaoming avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dvm's Issues

Zip Uncompress Stream Error when trying to install deno

After i installed dvm yesterday and tried to install version 0.2.2 i got a ZipUncompressStreamError error.

First i ran the following command:

$ dvm install 0.2.2

but then got greeted by this lovely message:

  downloading [====================] 100% 0.0s
Extracting zip contents
Error extracting archive
{ ZipUncompressStreamError: end of central directory record signature not found
    at C:\Users\Elias\AppData\Roaming\npm\node_modules\dvm\node_modules\yauzl\index.js:187:14
    at C:\Users\Elias\AppData\Roaming\npm\node_modules\dvm\node_modules\yauzl\index.js:631:5
    at C:\Users\Elias\AppData\Roaming\npm\node_modules\dvm\node_modules\fd-slicer\index.js:32:7
    at FSReqWrap.wrapper [as oncomplete] (fs.js:458:17) name: 'ZipUncompressStreamError' }
deno v0.2.2 is not installed. Use `dvm install 0.2.2` to install it first.

(This is the debug info i got by running with -d:)

  dvm:info check whether the current version is installed +0ms
  dvm:info deno v0.2.2 is not installed +3ms
  dvm:info try to download... 0.2.2 +0ms
  dvm:info using mirror denocn +1ms
  dvm:info using registry http://cdn.devtips.cn/deno/releases/download/ +0ms
  dvm:info remote package url: http://cdn.devtips.cn/deno/releases/download//v0.2.2/deno_win_x64.zip +0ms
  dvm:info file will save at C:\Users\Elias\AppData\Local\Temp\deno_win_x64.zip +2ms
  dvm:info file already exists, try to delete it... +1ms
  dvm:info delete successfully +0ms
  dvm:info start downloading +1ms
  downloading [====================] 100% 0.0s
  dvm:info download finish +7s
  dvm:info successfully downloaded files to local files +2ms
  dvm:info rename C:\Users\Elias\AppData\Local\Temp\deno_win_x64.zip-download-1544537685133 to C:\Users\Elias\AppData\Local\Temp\deno_win_x64.zip +1ms
Extracting zip contents
Error extracting archive
{ ZipUncompressStreamError: end of central directory record signature not found
    at C:\Users\Elias\AppData\Roaming\npm\node_modules\dvm\node_modules\yauzl\index.js:187:14
    at C:\Users\Elias\AppData\Roaming\npm\node_modules\dvm\node_modules\yauzl\index.js:631:5
    at C:\Users\Elias\AppData\Roaming\npm\node_modules\dvm\node_modules\fd-slicer\index.js:32:7
    at FSReqWrap.wrapper [as oncomplete] (fs.js:458:17) name: 'ZipUncompressStreamError' }
  dvm:info deno location: C:\Users\Elias\.dvm\0.2.2\deno.exe +18ms
deno v0.2.2 is not installed. Use `dvm install 0.2.2` to install it first.

Versions

I am using Windows 10 Home, ran the command in powershell and using dvm version 0.1.7.

`dvm ls` shows `bin` as a version

If you run dvm ls it will show bin as well. I guess it is just listing directories from ~/.dvm, so all that is needed is to filter bin.

$ dvm ls
bin
1.5.3
1.4.6
1.4.1
1.4.0
1.3.1

`doctor` command on dvm 1.6.0 on Windows is broken

doctor command on DVM 1.6.0 on Windows is broken, 'cause it is prepending dvm deno_bin into the user's environment path variables, which has lower priority than the system environment path. If one has already installed a deno via (for example: ) chocolatey(which puts deno bin path into the system environment path), DVM will not be working properly.

Idea: specify default registry

Hi,
first, thanks for your great work.

I installed dvm and tried:
dvm install 0.17.0
and got "Deno v0.17.0 is not yet released or available"

Adding the registry flag helped: dvm install 0.17.0 -r deno

Maybe the "deno" registry should be queried by default?
Or a warning should be showed, something like "You didn't specify a registry"

Discussion - Linking vs Setting env PATH to set the desired version

I notice that selecting the desired version works by using the filesystem to link the desired version into place.

This means that the effect of selecting a particular deno version is persistent and is shared by all shells/processes for that user (assuming the usual setup where a user has ~/.dvm/bin on the PATH).

A different method would be to manipulate the environment variable PATH of the current shell, so it would select the desired deno version only for one particular shell and later subprocesses. This is the method used by https://github.com/ghosind/dvm

Different trade-off depending on whether users would expect a dvm use to have a user-wide global persistent effect or whether the choice should be scoped to the current environment.

Use case for the latter could be when a user has different projects that need different deno versions and they run concurrently.

Handle corrupted archive files gracefully

Often the download process fails to properly fetch the full archive, as a result the unpacking operation refuses to continue until you manually delete the corrupted archive & re-trigger the download. Here's an example:

Shell output
deno v1.20.0 is not installed. do you want to install it? (Y/n)
downloading https://dl.deno.land/release/v1.20.0/deno-x86_64-unknown-linux-gnu.zip
Version has been found
Deno v1.20.0 has been downloaded
Archive:  /home/tamim/.dvm/versions/1.20.0/deno.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /home/tamim/.dvm/versions/1.20.0/deno.zip or
        /home/tamim/.dvm/versions/1.20.0/deno.zip.zip, and cannot find /home/tamim/.dvm/versions/1.20.0/deno.zip.ZIP, period.
thread 'main' panicked at 'assertion failed: unpack_status.success()', src/commands/install.rs:179:3
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

dvm should gracefully handle these cases by automatically deleting & re-downloading the release instead of just panic-quitting.

dvm should not attempt to replace /usr/bin/deno

Problem

Before I use dvm, I have install deno-bin from the Arch User Repository (/usr/bin/deno). When I try using dvm to install another deno version, it emits Permission denied (os error 13). I guess it is because dvm attempted to replace /usr/bin/deno.

Current Workaround

Uninstall deno-bin.

Unsupported arm64 architecture

Hey,

I tried to install the package to a Raspberry Pi4 and looks like the architecture for arm64 is not supported for the moment, and is not mentioned in the docs.

Are there any plans for the feature version to support this architecture?

image

Hardware Raspberry Pi4:
- 8 GB ram
- 64 card

OS: 
- Operating System: Ubuntu 20.04.1 LTS
- Architecture: arm64 

Installer defaults to `.bash_profile` for linux distributions

Issue Overview

In the install.sh file the following code is currently used to deal with shells:

case $SHELL in
/bin/zsh) shell_profile=".zshrc" ;;
*) shell_profile=".bash_profile" ;;
esac

The default case sets the shell_profile variable to ".bash_profile" without checking if this is a linux distribution.

I personally checked out the Linux distribution I use, which is Pop!_OS by System76, and it only ever sources the .bashrc file when I open a bash terminal. This is true even if I logout and in. This distribution is an Ubuntu-based distribution and most other Linux distributions only ever source ".bashrc" since they treat terminals run on the fly as non-login shells as opposed to Mac that treats these as login shells.

Simple Solution

To fix this issue the above code can be extended as follows to accommodate for bash on most Linux distributions:

Add the line of DENO_OS="linux" in the default case of the switch statement below:

if [ "$OS" = "Windows_NT" ]; then
	target="x86_64-pc-windows-msvc"
else
	case $(uname -s) in
	Darwin) target="x86_64-apple-darwin" ;;
	*)
		target="x86_64-unknown-linux-gnu"
		DENO_OS="linux"                              <-------[modified line]
	;;
	esac
fi

Next, prepend the default case of the switch statement below with [ "$DENO_OS" = "linux" ] && shell_profile=".bashrc"

case $SHELL in
/bin/zsh) shell_profile=".zshrc" ;;
*) [ "$DENO_OS" = "linux" ] && shell_profile=".bashrc" || shell_profile=".bash_profile" ;;    <-------[modified line]
esac

NOTE: It is important for the "$DENO_OS" part to be encapsulated in quotes, otherwise it won't work on Mac due to DENO_OS not being defined in that case leaving no left parameter for the binary operator of = to work with.

Advanced Solution

An even better solution can be found by looking at the install script for the n Node version manager that uses the
following code:

# SYNOPSIS
#   getShellInitFile
# DESCRIPTION
#   Returns the full path of the initalization file of the shell identified
#   via (environment variable) $SHELL, the user's default shell.
#   If $SHELL refers to an *unsupported* shell, the empty string is returned.
getShellInitFile() {
  local initFile=''

  # IMPORTANT:
  #   This STATEMENT MUST BE KEPT IN SYNC with cleanUpShellInitFile() in n-uninstall.
  case "$(basename -- "$SHELL")" in
    'bash')
      # !! Sadly, bash ONLY reads ~/.bash_profile in LOGIN shells, and on macOS (Darwin) ALL shells are login shells, so on macOS we must target ~/.bash_profile.
      [[ $(uname) == 'Darwin' ]] && initFile=~/.bash_profile || initFile=~/.bashrc
      ;;
    'ksh')
      initFile=~/.kshrc
      ;;
    'zsh')
      initFile=${ZDOTDIR:-~}/.zshrc
      ;;
    'fish')
      initFile=${XDG_CONFIG_HOME:-~/.config}/fish/config.fish
      ;;
    'pwsh') # PowerShell
      initFile=${XDG_CONFIG_HOME:-~/.config}/powershell/Microsoft.PowerShell_profile.ps1
      ;;
  esac

  printf %s "$initFile"

}

Link: https://github.com/mklement0/n-install/blob/master/bin/n-install
Line: 262

The above solution caters for quite a few different shells which is a plus.

dvm: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory

Here are my repro steps:

cd "$(mktemp -d)"

cat - > Dockerfile <<EOF
FROM ubuntu@sha256:aa6c2c047467afc828e77e306041b7fa4a65734fe3449a54aa9c280822b0d87d
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update -qq \
    && apt-get install -y -qq --no-install-recommends \
        unzip \
        curl \
        ca-certificates \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

RUN curl -fsSL https://deno.land/x/dvm/install.sh | sh

CMD ["/root/.dvm/bin/dvm"]
EOF

docker run -it --rm "$(docker build -q .)"

This gives me:

/root/.dvm/bin/dvm: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory

My first guess was to apt install libssl-dev, but I only get libssl.so.3. If I ln -s libssl.so.3 libssl.so.1.1 and equivalent for libcrypto.so.1.1, I get:

dvm: /lib/x86_64-linux-gnu/libssl.so.1.1: version `OPENSSL_1_1_0' not found (required by dvm)
dvm: /lib/x86_64-linux-gnu/libcrypto.so.1.1: version `OPENSSL_1_1_0' not found (required by dvm)

Which feels very reasonable.

Ubuntu (on 22.04) doesn't seem to have libssl.so.1 anymore:

apt-file find libssl.so.1; echo $?
1

Maybe statically linking those would be better?

Support Apple M1 architecture

Deno releases now include aarch64 builds, so support for Apple M1 processors is within reach.

Currently, dvm can be used to install x86_64 builds of Deno which seem to run OK in Rosetta. However, it'd be ideal if it installed aarch64 builds instead.

I was able to compile dvm on my M1 machine and install it with a modified script. However, to distribute dvm for Apple M1, the GitHub CI script would need to be modified as well. It may be possible for the rust toolchain to cross-compile for that target (still looking into it).

To recap, steps needed to support Apple M1:

  • modify dvm src to download aarch64 binaries (#[cfg(target_arch = "aarch64")])
  • modify GitHub Actions script to cross-compile a target for aarch64
  • modify install script to install the aarch64 target when detected

Perhaps dvm could also accept an --arch flag to allow users to install either aarch64 or x86_64 binaries.

Unable to install deno via dvm on Linux

I am getting an error during the deno.zip inflation process.

โžœ  ~ dvm --version
dvm 1.4.6
 ~ RUST_BACKTRACE=full dvm install
Checking for latest version
The latest version is v1.12.0
downloading https://dl.deno.land/release/v1.12.0/deno-x86_64-unknown-linux-gnu.zip
Version has been found
Deno v1.12.0 has been downloaded
Archive:  /home/nick/.dvm/1.12.0/deno.zip
  inflating: deno                    
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `"deno 1.12.0+1ad6575"`,
 right: `"deno 1.12.0"`', src/commands/use_.rs:88:3
stack backtrace:
   0:     0x561add265ee3 - <unknown>
   1:     0x561add2492cc - <unknown>
   2:     0x561add265831 - <unknown>
   3:     0x561add265294 - <unknown>
   4:     0x561add27e783 - <unknown>
   5:     0x561add27e6fc - <unknown>
   6:     0x561add27e6ad - <unknown>
   7:     0x561add27e670 - <unknown>
   8:     0x561add2159b6 - <unknown>
   9:     0x561add21a4ec - <unknown>
  10:     0x561add20e55d - <unknown>
  11:     0x561add21b2d9 - <unknown>
  12:     0x7f55f7f42565 - __libc_start_main
  13:     0x561add20e47a - <unknown>
  14:                0x0 - <unknown>
[1]    2215901 IOT instruction (core dumped)  RUST_BACKTRACE=full dvm install

System information:

  ~ neofetch
             /////////////                nick@pop-os 
         /////////////////////            ----------- 
      ///////*767////////////////         OS: Pop!_OS 21.04 x86_64 
    //////7676767676*//////////////       Host: MS-7B50 1.0 
   /////76767//7676767//////////////      Kernel: 5.11.0-7620-generic 
  /////767676///*76767///////////////     Uptime: 14 days, 57 mins 
 ///////767676///76767.///7676*///////    Packages: 2593 (dpkg), 25 (flatpak) 
/////////767676//76767///767676////////   Shell: zsh 5.8 
//////////76767676767////76767/////////   Resolution: 2560x1440, 1920x1080 
///////////76767676//////7676//////////   DE: GNOME 3.38.4 
////////////,7676,///////767///////////   WM: Mutter 
/////////////*7676///////76////////////   WM Theme: Pop 
///////////////7676////////////////////   Theme: Pop [GTK2/3] 
 ///////////////7676///767////////////    Icons: Pop [GTK2/3] 
  //////////////////////'////////////     Terminal: konsole 
   //////.7676767676767676767,//////      CPU: Intel i7-9700K (8) @ 4.900GHz 
    /////767676767676767676767/////       GPU: NVIDIA GeForce RTX 2070 
      ///////////////////////////         Memory: 14393MiB / 32042MiB 
         /////////////////////
             /////////////                                        

~/.zshrc setup for deno and dvm

# deno
export DENO_INSTALL="/home/nick/.deno"
export DVM_DIR="/home/nick/.dvm"
export PATH=$PATH:$DENO_INSTALL/bin
export PATH=$PATH:$DVM_DIR/bin

Directory output

โžœ  ~ l ~/.dvm
total 16K
drwxrwxr-x  4 nick nick 4.0K Jul 16 10:19 .
drwxr-xr-x 52 nick nick 4.0K Jul 16 10:21 ..
drwxrwxr-x  2 nick nick 4.0K Jul 16 10:19 1.12.0
drwxrwxr-x  2 nick nick 4.0K Jul 16 10:16 bin
โžœ  ~ l ~/.dvm/1.12.0
total 114M
drwxrwxr-x 2 nick nick 4.0K Jul 16 10:19 .
drwxrwxr-x 4 nick nick 4.0K Jul 16 10:19 ..
-rwxr-xr-x 1 nick nick  83M Jul 13 01:56 deno
-rw-rw-r-- 1 nick nick  32M Jul 16 10:19 deno.zip
โžœ  ~ l ~/.dvm/1.12.0/deno
-rwxr-xr-x 1 nick nick 83M Jul 13 01:56 /home/nick/.dvm/1.12.0/deno

Could you support using canary deno?

As in topic, need that to not run deno upgrade --canary each time I do something indeno_std and then deno upgrade to return to latest release.

Command not found

Hi ๐Ÿ‘‹ friends I would like to know if after install the dvm command I have to add it to the PATH or something like that because I after install the dvm I tried to run deno --version and in the terminal appears one message related a permission I'm running again with sudo and later another message that says deno: command not found.

I'm using zsh and macos.

Thanks

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior:

  1. [First Step]
  2. [Second Step]
  3. [and so on...]

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Versions

You can get this information from copy and pasting the output of dvm --version from the command line. Also, please include the OS and what version of the OS you're running.

Additional context

Add any other context about the problem here.

alias feature

nvm.sh has a very useful feature called alias. For example, if the user subscribes (nvm use) to the stable alias, the latest available stable version of Node.js will always be used without running nvm use <number> again.

Suggestion

Commands

  • dvm alias and dvm ls list all aliases.
  • dvm alias A B sets alias A to point to B.
  • dvm use X sets the target of alias X as deno executable.
  • dvm use system removes the deno command that is managed by dvm to allow user to use system's deno.

Default aliases

  • default
  • deno
  • stable
  • system (this alias in particular is not configurable)

What is the purpose of environment variable `$DENO_INSTALL` in the install script?

The install script sets the environment variable and adds $DENO_INSTALL/bin to user's path.

I thought it would be used by Deno's binary, and had a look at the Deno manual. There was only DENO_INSTALL_ROOT.

So it's used by dvm itself. However, the Deno binaries are installed to $DVM_DIR/bin. Neither could I find any lines in the source code that read / write the environment DENO_INSTALL.

Thanks for your reply.

install.sh doesn't work for .zshrc with a symbolic link

I have my zsh configuration managed by stow. That saves your dotfiles in a separate folder and create a symlink to folder where the file was previously. Probably it is the problem I dont know.

When I try to install dvm the script detects that my default shell is bash and my default shell is zsh. So I have to take the ENV variables and put it to my zshrc.

updating

Currently, whenever a new version of Deno is released, there's no straightforward way to "update" to it.

  • If you use the deno upgrade command, it works, but the new version isn't stored by dvm and it will be lost if you switch to another version of Deno.
  • If you run dvm install to install and switch to the latest version, you end up with every patch version of Deno saved/installed. I don't mind keeping a v1.16.x and a v1.17.x installed, but I'm not all that likely to be switching back and forth between v1.18.2 and v1.18.1.

It'd be nice to have a dvm upgrade command that replaces the currently active installation with the latest installation as an alternative to the deno upgrade command.

On a related note, it may be worth adding a dvm upgrade self command that acts as an alias to curl -fsSL https://deno.land/x/dvm/install.sh | sh for updating the tool itself.

why use npm?

Deno has discarded node modules.
Why still use npm to install?

dvm install does not work on MAC OS X to install any version of Deno

Describe the bug

dvm install always results in an error on my MAC OS X 10.15.4

To Reproduce

Steps to reproduce the behavior:

  1. dvm install latest or dvm install 1.2.0

Expected behavior

I expect Deno to be installed. Instead no matter what (clean .dvm dir, no .dvm dir) I get an error that the directory exists, which is itself created by dvm before it reports that error.

 dvm install latest
  downloading [====================] 100% 0.0s
Extracting gz contents
Error extracting archive
Error: ENOTEMPTY: directory not empty, rmdir '/Users/jminard/.dvm/latest'
    at Object.rmdirSync (fs.js:789:3)
    at /Users/jminard/WebstormProjects/untitled1/node_modules/dvm/bin/dvm.js:410:10
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  errno: -66,
  syscall: 'rmdir',
  code: 'ENOTEMPTY',
  path: '/Users/jminard/.dvm/latest'
} latest

removing the directory does not solve the problem, dvm will recreate the directory and then complain it already exists.

Versions

  • 0.3.1

Version check failed when installing deno 1.12.0

dvm install 1.12.0 

downloading https://dl.deno.land/release/v1.12.0/deno-x86_64-apple-darwin.zip
Version has been found
Deno v1.12.0 has been downloaded
Archive:  /Users/liuhaoranhuang/.dvm/1.12.0/deno.zip
  inflating: deno                    
thread 'main' panicked at 'assertion failed: `(left == right)`
  left: `"deno 1.12.0+1ad6575"`,
 right: `"deno 1.12.0"`', src/commands/use_.rs:88:3
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[1]    80503 abort      dvm install 1.12.0

when use assertion to check deno version. the LHS is deno 1.12.0+1ad6575 while RHS is deno 1.12.0
error happened on src/commands/use_.rs:88:3

Deno is not installed while it's correclty installed on MacOS

Hi,

when i'm installing deno everything is ok, files are well created

$ dvm install
Installing deno v1.15.3 from cache...
replace /Users/user/.dvm/versions/v1.15.3/deno? [y]es, [n]o, [A]ll, [N]one, [r]ename: y
Deno v1.15.3 has installed.

But when i'm trying to use deno, i'm encountering this error.

$ dvm use
Deno 1.15.3 is not installed, you can run 'dvm install 1.15.3' to install it.

I'm using a .dvmrc file

execute dvm use error

Error message

$ dvm use 1.3.2
No such file or directory (os error 2)

deno v1.3.2 installed

$ ls -al /Users/abc/.dvm/1.3.2
-rwxr-xr-x  1 abc  staff  42532056  8 29 22:13 deno
-rw-r--r--  1 abc  staff  15346641  9  1 11:31 deno.zip

Environmental

  • dvm version: dvm 1.1.8
  • macOS Mojave 10.14.6

In v1.8.3, The command does not work on Intel Macs.

As the title says.

I installed v1.8.3 today with the following command, but when I run the command, nothing shows up.
I have already confirmed that v1.8.2 works.

$ curl -fsSL https://deno.land/x/dvm/install.sh | sh
... (omission) ...
Dvm was installed successfully to /Users/takaaki.ando/.dvm/bin/dvm
Run 'dvm --help' to get started.
$ dvm -V
$ dvm list
$ dvm install 1.23.3

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.