Homebrew不能使用

来源:互联网 发布:化工与人工智能 编辑:程序博客网 时间:2024/06/06 01:17

问题出现在RN环境突然失效,npm -v 出现command not found,在国外网站上提示执行node卸载重新安装

brew update$ brew uninstall node$ brew install node$ sudo brew postinstall node

当执行到最后的时候,提示我

Error: Could not symlink share/doc/node/gdbinit

/usr/local/share/doc/node is not writable.


然后我就使用sudo,后来提示

sudo brew link --overwrite node

Password:

Error: Running Homebrew as root is extremely dangerous and no longer supported.

As Homebrew does not drop privileges on installation you would be giving all

build scripts full access to your system.


搜索这个问题的时候网上给出的解决方法就是给当前的用户写的权限而非使用sudo

sudo chown -R $(用户名) /usr/local

sudo chown -R user /usr/local

Password:

brew link --overwrite node

Linking /usr/local/Cellar/node/8.3.0... 9 symlinks created


执行完之后,顺利覆盖之前link,命令可以正常执行。在此记录下。

原创粉丝点击