我使用的是Apple M1 Macbook Pro,带有“zsh”终端,使用“nvm install node”命令安装Node时出现问题。在尝试了该nvm命令后,我直接从https://nodejs.org/en/download/下载了Node
我想确保节点安装通过PATH引用NVM安装节点目录。但是,这是我看到的。
当我运行命令“which node”时,我得到了下面的当前输出。我也列出了预期的输出。有没有办法修复这个问题?
Current output: /usr/local/bin/node
Expected output: /Users/username/.nvm/versions/node/v14.15.4/bin/node
3条答案
按热度按时间qfe3c7zg1#
如果你仔细看看nvm的安装说明,你会注意到有一个关于如何设置更深的shell集成的信息。
甚至在brew中注意到
既然您对zsh更深层的shell集成感兴趣,那么就这样做吧(我有意不包括官方文档中的片段,这样它就会是最新的)
cygmwpex2#
1.打开终端并运行
git克隆https://github.com/nvm-sh/nvm.git ~/.nvm
1.运行
源代码nvm.sh
8yoxcaq73#
它在nvm Github readme中提到过。
TLDR
将下面的代码复制到
.zshrc
文件中: