我该如何解决这个问题:错误:/ usr / local / Cellar不可写?为什么chown返回"非法用户名"?

时间:2017-12-28 08:05:53

标签: node.js macos homebrew chown

我试图使用Homebrew安装Nodejs(我使用macOS Sierra 10.12.6),所以我在终端写道:

brew install node

然后又回来了:

Error: /usr/local/Cellar is not writable. You should change the
ownership and permissions of /usr/local/Cellar back to your
user account:
sudo chown -R $(whoami) /usr/local/Cellar
Error: Cannot write to /usr/local/Cellar

然后我写道:

 sudo chown -R $(whoami) /usr/local/Cellar

然后又回来了:

usage: chown [-fhv] [-R [-H | -L | -P]] owner[:group] file ...
   chown [-fhv] [-R [-H | -L | -P]] :group file ...

之后我尝试了:

sudo chown -R $(whoami) $(brew --prefix)/*

然后又回来了:

chown: /usr/local/Cellar: illegal user name

我可以请你帮忙吗? (注意:用户名是正确的)

0 个答案:

没有答案