zen*_*god 3 macos homebrew node.js
首先,我node在macOS终端上运行,并得到
bash: /usr/local/bin/node: No such file or directory
Run Code Online (Sandbox Code Playgroud)
我跑步brew install node并得到
Warning: node 12.10.0 is already installed, it's just not linked You can use `brew link node` to link this version.
于是我运行brew link node,并得到
Error: Could not symlink include/node/common.gypi
/usr/local/include/node is not writable.
Run Code Online (Sandbox Code Playgroud)
我想这是一些权限问题。所以我用sudo运行它并得到
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.
Run Code Online (Sandbox Code Playgroud)
然后,我尝试brew uninstall node,并重复上述所有步骤,仍然出现相同的错误。我该怎么办?
注意:切勿sudo与一起使用brew。brew以as身份运行root可能会更改brew相关文件的所有者,并使当前用户无法访问它。
问题的答案:您可能/usr/local/include/node已经通过使用破坏了目录的权限sudo。要解决此问题,
rm -rf /usr/local/include/node
brew unlink node
brew link node
Run Code Online (Sandbox Code Playgroud)
如果以上命令不能解决您的问题。尝试/usr/local递归修复所有文件夹权限。然后再次尝试上述修复。
sudo chown -R $(whoami):admin /usr/local/*
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
173 次 |
| 最近记录: |