- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我刚刚使用以下命令安装了 Node 和 Yarn:
brew install node
brew install yarn --without-node
node -v
v11.8.0
-a node
node is /usr/local/bin/node
yarn -v
1.13.0
type -a yarn
yarn is /usr/local/bin/yarn
但是,如果我在终端 npm
中写入,则会显示“zsh:找不到命令:npm”
在我的:~/.zshrc
中,我有:
ZSH=$HOME/.oh-my-zsh
# You can change the theme with another one:
# https://github.com/robbyrussell/oh-my-zsh/wiki/themes
ZSH_THEME="robbyrussell"
# Useful plugins for Rails development with Sublime Text
plugins=(gitfast last-working-dir common-aliases sublime zsh-syntax-highlighting history-substring-search)
# Prevent Homebrew from reporting - https://github.com/Homebrew/brew/blob/master/share/doc/homebrew/Analytics.md
export HOMEBREW_NO_ANALYTICS=1
# Actually load Oh-My-Zsh
source "${ZSH}/oh-my-zsh.sh"
unalias rm # No interactive rm by default (brought by plugins/common-aliases)
# Load rbenv if installed
export PATH="${HOME}/.rbenv/bin:${PATH}"
type -a rbenv > /dev/null && eval "$(rbenv init -)"
# Rails and Ruby uses the local `bin` folder to store binstubs.
# So instead of running `bin/rails` like the doc says, just run `rails`
# Same for `./node_modules/.bin` and nodejs
export PATH="./bin:./node_modules/.bin:${PATH}:/usr/local/sbin"
# Store your own aliases in the ~/.aliases file and load the here.
[[ -f "$HOME/.aliases" ]] && source "$HOME/.aliases"
# Encoding stuff for the terminal
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
我尝试使用本指南卸载并重新安装 Node 和 Yarn:How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)
但我仍然遇到同样的错误。
最佳答案
当我在 ~/.zshrc
开头添加 source ~/.bash_profile
时,它对我有用,而且我还必须删除
test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash"
在~/.bash_profile
中。这是我无意中从 iTerm2 安装的 shell 集成。
关于node.js - zsh : command not found: npm,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54390473/
我正在尝试在 Macos big sur 上执行 .zsh 脚本,但它不允许我这样做。 每当我在终端中运行 .zsh 时,它会显示“/bin/zsh:无法打开输入文件:file-name.zsh” 我
在此示例中,我尝试将所有值从一个关联数组复制到另一个关联数组。我正在使用 zsh -n 检查我的代码是否存在语法错误,但是这个会抛出一个 test:12: bar: assignment to inv
我想获取$*的最后一个元素。到目前为止,我发现的最好的是: last=`eval "echo \\\$$#"` 但这似乎太不透明了。 最佳答案 在zsh中,您可以使用P parameter expa
有没有办法做type of auto-suggestion Fish does在 Zsh 中? 最佳答案 https://github.com/tarruda/zsh-autosuggestions正
我希望通过为 dtach 创建一个 zsh 别名来加快我的工作流程,其功能如下: dtach -A /tmp/{directoryName} -r winch dvtm 我尝试过这样做,但不起作用。
我已经安装了 NVM,然后我发现了 oh-my-zsh 并安装了它。它似乎有一个 nvm 插件,我在 .zshrc 中启用了它。 我还将其放入我的 .zprofile export NVM_DIR="
每当我运行 bower install或任何 bower命令,它最终运行为 bundle install或来自 bundler 的其他内容.我正在使用 oh-my-zsh 运行 zsh shell。它
如果在 bash 我做(从命令行) echo $0 输出是 bash 和其他 shell 类似。 但是如果我在 中做同样的事情zsh 输出是 -zsh 为什么zsh前面有那个破折号? 最佳答案 she
关于bower.io有一条警告说: Warning On prezto or oh-my-zsh, do not forget to alias bower='noglob bower' or bow
我想为接受目录作为参数的命令编写自定义补全。我认为通过示例来解释它应该如何工作是最简单的。 假设我在某处定义了一个目录列表: d=(~/somedir/foo ~/somedir/foo/bar ~/
我正在尝试构建一个 zsh 函数,该函数根据时间间隔返回输出。最初“你渴了”条件为真,但在通过命令行更改变量 thirsty 并将其设置为 false 后,初始 if 语句通过,但变量 thirsty
如果在 Zsh 中(在 macOS 或 Ubuntu 上)连续运行以下命令: date +%s echo \ a\ b\ c 然后可以按 5 次向上箭头滚动回到第一个命令。 有没有一种方法可以通过两次
在常规数组中,我可以使用 (i) 或 (I) 来搜索与给定值匹配的条目的索引(从头开始的第一个匹配项或数组的末尾,分别): list=(foo bar baz) echo $list[(i)bar]
我是 zsh 的新手。 我可以输入类似 cd %wiki 的内容吗?跳转到 ~/prj/golang/gowiki如果它是独一无二的。 但是,如果 cd %unix 可能有两个以上的目录, 只显示匹配
我尝试了无数方法来获得我想要的东西,但似乎没有任何效果。我总是得到类似 2:not found 的结果. 我想捕获命令的输出,然后测试它是否等于“!”,如下所示: function test() {
我在我的 mac 上使用 zsh (oh-my-zsh),我不明白为什么在我的输出结束时总是有这个字符:“%” 如果我不把 export TERM="xterm-256color"放在我的 ~/.zs
给定一个 Zsh 数组 myarray,我可以把它作为一个子集数组 set -A subarray for el in $myarray do if [[ $el =~ *x*y* ]] th
有时候我们在终端运行一个命令,输出太大了,忘了把“|less”放在最后。所以我想知道当输出在 zsh 中太大时是否可以分页? 我尝试使用 python 和 less 来实现这个功能: #!/usr/b
我有一个设置,我很高兴在机器之间共享我的配置文件,但我发现我经常想在 zsh (Ctrl + R) 中搜索,我不记得我在哪台机器上输入了命令。理想情况下,我希望从我的任何机器中搜索以前命令的规范重复列
如何根据现有的完成定义和默认参数为函数设置完成。 一个简化的例子(可以改写为别名): gpl() { git pull origin $@ } 这应该与 git pull origin 之后的
我是一名优秀的程序员,十分优秀!