我正在按照找到here的步骤安装DFINITY Canister SDK。
当我运行下面的命令时,没有创建目录dfx (在/bin下),因此无法识别dfx命令:
adel@adel-VirtualBox:~$ sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"
info: Executing DFINITY SDK install script, commit: dd2134837704e0daca074dd3fe09ee4ff6ebbf97
DFINITY SDK
Please READ the following license:
DFINITY Foundation -- All rights reserved. This is an ALPHA version
of the DFINITY Canister Software Development Kit (SDK). Permission is hereby granted
to use AS IS and only subject to the Alpha DFINITY Canister SDK License Agreement which
can be found here [https://sdk.dfinity.org/sdk-license-agreement.txt]. It comes with NO WARRANTY.
Do you agree and wish to install the DFINITY ALPHA SDK [y/N]?
y
info: Version found: 0.6.10
info: Creating uninstall script in ~/.cache/dfinity
info: uninstall path=/home/adel/.cache/dfinity/uninstall.sh
info: Checking for latest release...
Will install in: /home/adel/bin
info: Installed /home/adel/bin/dfx
adel@adel-VirtualBox:~$ dfx --version
Command 'dfx' not found, did you mean:
command 'fx' from snap fx (11.1.0)
command 'dfix' from snap dfix (0.3.5)
command 'dx' from deb dx (1:4.4.4-12build2)
command 'dex' from deb dex (0.8.0-2)
command 'dfc' from deb dfc (3.1.1-1)
command 'df' from deb coreutils (8.30-3ubuntu2)
See 'snap info <snapname>' for additional versions.
adel@adel-VirtualBox:~$ cd /bin
adel@adel-VirtualBox:/bin$ cd dfx
bash: cd: dfx: No such file or directory下面是我的Ubuntu版本:
adel@adel-VirtualBox:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal发布于 2020-10-08 15:49:41
从install命令的输出看,dfx似乎安装在/home/adel/bin/dfx中。你能验证一下吗:
test -e /home/adel/bin/dfx && echo yay found it || echo oh no如果没有,它看起来好像安装不起作用。
如果是,您可以直接运行它:
"$HOME/bin/dfx" --versionecho "$PATH" | tr : "\n" | grep "$HOME/bin"如果没有,您可以使用以下命令添加:
echo 'export PATH="$PATH:$HOME/bin"' >> "$HOME/.bashrc"
. "$HOME/.bashrc"
dfx --version发布于 2021-08-12 07:46:43
当我使用该命令时
dfx --version它无法识别。
但是当我使用完整的路径时,它是有效的。
sudo /home/osboxes/bin/dfx --versiondfx 0.8.0
发布于 2021-11-16 05:00:44
我也有同样的问题。由于某种原因,有一个~/bin目录,所以我首先删除它,然后按照前面的答案操作:
ubuntu@ip-172-31-81-158:~$ PATH=~/bin:$PATH
ubuntu@ip-172-31-81-158:~$ export PATH
ubuntu@ip-172-31-81-158:~$ sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"
info: Executing dfx install script, commit: 0a3bd5b38e498f899c8074d734116c10e0e53ca5
info: Version found: 0.8.3
info: Creating uninstall script in ~/.cache/dfinity
info: uninstall path=/home/ubuntu/.cache/dfinity/uninstall.sh
info: Checking for latest release...
Will install in: /home/ubuntu/bin
info: Installed /home/ubuntu/bin/dfx
ubuntu@ip-172-31-81-158:~$ dfx --version
dfx 0.8.3https://stackoverflow.com/questions/64228879
复制相似问题