我的 OSX 10.13.4 机器上有很多权限问题。Homebrew 似乎无法正确完成软件包安装。
以下是 的示例,npm
但我遇到了同样的问题node
。如果我理解正确的话,两者似乎都已安装但未链接到我的环境。我已经尝试了所有能找到的方法,但我的想法已经枯竭。我还尝试了卸载/重新安装 Homebrew
brew install npm
我收到一个符号链接错误:
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink include/node/android-ifaddrs.h
/usr/local/include/node is not writable.
npm -v gives env: node: No such file or directory
brew link node
并brew postinstall node
给出同样的错误
brew doctor
给了我另一堆警告:
Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
node
Warning: Broken symlinks were found. Remove them with `brew prune`:
brew prune
给出错误:Permission denied @ unlink_internal - /usr/local/lib/node_modules/npm/node_modules/.bin/JSONStream