nvm安装无法附加nvm源字符串

时间:2018-05-04 12:19:59

标签: nvm

我下载了NVM(在Mac High Sierra上),其中包含:

wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

下载有效,但之后出现了错误:

Appending nvm source string to /Users/User/.bashrc
bash: line 353: /Users/User/.bashrc: Permission denied
=> Appending bash_completion source string to /Users/User/.bashrc
bash: line 360: /Users/User/.bashrc: Permission denied

如何授予权限 - 或手动将字符串添加到.bashrc?如果是这样,字符串需要什么?

1 个答案:

答案 0 :(得分:0)

您要查找的行如下:

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

将它们添加到.bashrc的最后。