【发布时间】:2017-08-14 20:52:43
【问题描述】:
os: macOS Sierra 10.12.6 (16G29)
terminal app: Hyper 1.3.3.1754
nvm: 0.33.2
我按照说明安装了nvm,前段时间没有问题。最近,它和它负责的命令——node 和npm——停止工作。
找不到 nvm/npm/node 命令
【问题讨论】:
标签: shell command-line config nvm dotfiles
os: macOS Sierra 10.12.6 (16G29)
terminal app: Hyper 1.3.3.1754
nvm: 0.33.2
我按照说明安装了nvm,前段时间没有问题。最近,它和它负责的命令——node 和npm——停止工作。
找不到 nvm/npm/node 命令
【问题讨论】:
标签: shell command-line config nvm dotfiles
我意识到发生这种情况是因为我最近将系统默认 shell 从 bash 切换到 zsh —chsh -s /bin/zsh — 没有解决 ~/.bash_profile 的内容,bash 提供而不是 zsh。
nvm 安装脚本curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
将以下内容放在适当的配置文件中——其中之一:~/.bash_profile、~/.zshrc、~/.profile 或 ~/.bashrc。
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
在安装时,我使用了bash,该位被放置在~/.bash_profile 中。将该内容处理到~/.zshrc 后,这些命令又可以正常工作了。
【讨论】: