Shell 为什么有与nvm相关的命令—;nvm,节点,npm—;停止工作?

Shell 为什么有与nvm相关的命令—;nvm,节点,npm—;停止工作?,shell,command-line,config,nvm,dotfiles,Shell,Command Line,Config,Nvm,Dotfiles,根据说明,我在不久前安装了nvm,没有问题。最近,它和它负责的命令——node和npm停止工作 nvm/npm/node命令未找到我意识到发生这种情况是因为我最近将系统默认shell从bash切换到了zsh-chsh-s/bin/zsh,而没有寻址~/.bash\u profile的内容,它是由bash提供的,但不是zsh 安装脚本 curl-o-https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh |bash 将

根据说明,我在不久前安装了
nvm
,没有问题。最近,它和它负责的命令——
node
npm
停止工作


nvm/npm/node命令未找到

我意识到发生这种情况是因为我最近将系统默认shell从bash切换到了zsh-
chsh-s/bin/zsh
,而没有寻址
~/.bash\u profile
的内容,它是由
bash
提供的,但不是
zsh

安装脚本
curl-o-https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh |bash

将以下内容放置在相应的配置文件中-其中之一:
~/.bash_profile
~/.zshrc
~/.profile
~/.bashrc

os: macOS Sierra 10.12.6 (16G29)
terminal app: Hyper 1.3.3.1754
nvm: 0.33.2
在安装时,我使用了
bash
,该位被放置在
~/.bash\u配置文件中。将该内容转换为
~/.zshrc
使命令再次工作

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