0

我想执行命令 gclient。我已经在 PATH 中包含了它的位置。但我不能直接通过命令执行它。有人能告诉我为什么吗?

~
❯ echo $PATH
/User/merle/depot_tools:/Users/merle/.nvm/versions/node/v11.10.0/bin:/usr/local/opt/mysql@5.5/bin:/Library/Frameworks/Python.framework/Versions/3.5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands

~
❯ ls depot_tools | grep gclient
README.gclient.md
annotated_gclient.py
gclient
gclient-new-workdir.py
gclient.bat
gclient.py
gclient_completion.sh
gclient_eval.py
gclient_paths.py
gclient_scm.py
gclient_utils.py

~
❯ gclient
zsh: command not found: gclient

~
❯ cd depot_tools

~/depot_tools master
❯ ./gclient
Usage: gclient.py <command> [options]

Meta checkout dependency manager for Git.

Commands are:.......
4

3 回答 3

1

再看看你的路径:

export PATH=/User/merle/depot_tools:/Users/merle/...

您的系统是否仅包含 1 个用户或多个用户???

它应该是:

export PATH=/Users/merle/depot_tools:/Users/merle/...
于 2019-07-17T02:01:10.667 回答
1

我想你可能会忘记

source ~/.nvm/nvm.sh

如果你想自动加载它,有两种方法

open ~/.zshrc 

1.添加

source ~/.nvm/nvm.sh

2.或添加

export NVM_DIR="/Users/YOUR_USER_NAME(you need use you user name)/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvm

希望这可以帮到你

于 2019-11-24T04:11:47.700 回答
0

ZSH:找不到命令

问题是 .zshrc,它丢失了。对我有用的解决方案:

您必须创建一个 .zshrc 文件。创建使用“vim .zshrc”命令,然后插入你的路径“export PATH="$PATH: pwd/flutter/bin"

保存并完全退出您的终端。安装 gem cocoa pods 然后接受许可。你已准备好出发。

于 2021-11-23T05:56:53.560 回答