简体   繁体   English

ZSH:找不到命令

[英]ZSH: command not found

I want to execute command gclient.我想执行命令 gclient。 I have already included its location in PATH.我已经在 PATH 中包含了它的位置。 But I cannot directly execute it by command.但是我不能直接通过命令执行它。 Can someone tell me why?有人能告诉我为什么吗?

~
❯ 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:.......

Take another look at your path:再看看你的路径:

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

Does your system contain just 1 User or multiple Users ???您的系统是否只包含 1 个用户或多个用户???

It should read:它应该是:

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

i think you may forget我想你可能会忘记

source ~/.nvm/nvm.sh

if you want automatically load it ,there are two ways如果你想自动加载它,有两种方法

open ~/.zshrc 

1.add 1.添加

source ~/.nvm/nvm.sh

2.or add 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

hope this can help you希望这可以帮到你

"ZSH: command not found" The Problem was .zshrc, it was missing. “ZSH:找不到命令”问题是 .zshrc,它丢失了。 solution which worked for me : You have to create a .zshrc file.对我有用的解决方案:您必须创建一个 .zshrc 文件。 to create use "vim .zshrc" command then insurt your path "export PATH="$PATH: pwd /flutter/bin" " save and completely exit your terminal completely.创建使用“vim .zshrc”命令然后保护你的路径“export PATH="$PATH: pwd /flutter/bin"”保存并完全退出你的终端。 install gem cocoa pods then accept the license.安装 gem cocoa pods 然后接受许可证。 you are good to go.你已准备好出发。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM