Zsh: command not found: dfx

Another day, another dfx issue…

I recently upgraded dfx v0.17.0 and was looking to dowgrade.

As a result, the command dfx is not found anymore.

❯ DFX_VERSION=0.15.2 sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)"
info: Executing dfxvm install script, commit: 5a2d2cc37a1af97f3279e7c9b4e5e7f45c5521ae
info: Downloading latest release...
info: Checking integrity of tarball...
dfxvm-aarch64-apple-darwin.tar.gz: OK

Welcome to dfxvm!

This will install dfxvm, and download and install dfx.

The dfxvm and dfx commands will be added to the following directory:

   /Users/daviddalbusco/Library/Application Support/org.dfinity.dfx/bin

This path will then be added to your PATH environment variable by
modifying the profile files located at:

   /Users/daviddalbusco/.profile
   /Users/daviddalbusco/.zshenv

The following binaries were found on your PATH and will be deleted:
   /usr/local/bin/dfx

Current installation options:

            dfx version: 0.15.2
     delete dfx on PATH: yes
   modify PATH variable: yes

Proceed with installation?: Proceed with installation (default)

info: deleted: /Users/daviddalbusco/.cache/dfinity/uninstall.sh
info: deleted: /usr/local/bin/dfx
info: creating /Users/daviddalbusco/Library/Application Support/org.dfinity.dfx/env
info: installing dfx 0.15.2
info: downloading https://github.com/dfinity/sdk/releases/download/0.15.2/dfx-x86_64-apple-darwin.tar.gz.sha256
  [00:00:00] [#########################################################################################################################] 97B/97B (116B/s, 0s)
info: downloaded https://github.com/dfinity/sdk/releases/download/0.15.2/dfx-x86_64-apple-darwin.tar.gz.sha256
info: downloading https://github.com/dfinity/sdk/releases/download/0.15.2/dfx-x86_64-apple-darwin.tar.gz
  [00:00:03] [##############################################################################################################] 92.19MB/92.19MB (29.80MB/s, 0s)
info: downloaded https://github.com/dfinity/sdk/releases/download/0.15.2/dfx-x86_64-apple-darwin.tar.gz
info: verified checksum 867351f51c626aa9839cbe7385051ca45e3027725e8c2fb2775be55ec3c30fd1
info: extracted archive
info: installed dfx 0.15.2
info: set default version to dfx 0.15.2
info: updating /Users/daviddalbusco/.profile
info: updating /Users/daviddalbusco/.zshenv

dfxvm is installed now.

To get started you may need to restart your current shell.
This would reload your PATH environment variable to include
the dfxvm bin directory.

To configure your shell, run:
  source "$HOME/Library/Application Support/org.dfinity.dfx/env"

exit
❯ dfx start
zsh: command not found: dfx

Ah missed the prompt, it’s so obvious. My bad I guess.

Opening a new shell solved it.

1 Like