用brew安装node遇到的问题


//删除文件夹
sudo rm -rf /usr/local/share/systemtap/
//删除之前安装的node
brew uninstall node
//重新安装
brew install node

原文Permissions denied to override or delete node targets

2.nodejs终端命令行模式怎么退出

nodejs的命令需要在前面加点,可用.help查看所有命令,退出命令是.exit

原文nodejs终端命令行模式怎么退出

3 rm: /usr/local/share/systemtap/tapset/node.stp: Permission denied

//删除文件夹
sudo rm -rf /usr/local/share/systemtap/tapset/node.stp

4.brew doctor后出现Unbrewed header files were found in /usr/local/include.

brew doctor 的作用检查homebrew,各模块是否正常

用brew安装node遇到的问题_第1张图片

解决方法:

删除那些文件就可以了。

原文: 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.

总结:

我出现这些问题的原因是node之前手动安装了,而node不是用brew安装的,所以会产生这样的问题。实际上,Homebrew 将软件包分装到单独的目录(/usr/local/Cellar),然后 symlink 到 /usr/local 中。

接下来我说说如何遇到上边那些问题的。因为无法还原,就简单的记录下过程。

  • 安装node。

    • brew install node
    提示:
    Warning: Could not link node. Unlinking...  
    Error: The `brew link` step did not complete successfully  
    The formula built, but is not symlinked into /usr/local  
    You can try again using `brew link node'  
  • 根据提示,进行将brew管理的node和手动安装的node进行链接。

    • brew link node

      Error: Could not symlink file: /usr/local/Cellar/node/0.10.0/bin/node
      Target /usr/local/bin/node already exists. You may need to delete it.
      To force the link and delete this file, do:
      brew link --overwrite formula_name
      To list all files that would be deleted:
      brew link --overwrite --dry-run formula_name
  • 我尝试执行brew link –overwrite –dry-run formula_name,列出要删除的冲突文件,比如: /usr/local/bin/node删掉。
//删除
rm  ‘/usr/local/bin/node’
//如果无法删除,则添加-rf,删除前要格外小心,因为-rf他不会提示,就强制删除了。
rm  -rf ‘/usr/local/bin/node’
// 或者获取sudo权限删除
 sudo rm  -rf ‘/usr/local/bin/node’
  • 删除完。我遇到开始的第一个问题了。Could not symlink share/systemtap/tapset/node.stp /usr/local/share/systemtap/tapset is not writable。所以,就删除,然后重新安装了一边,就好了。

//删除文件夹
sudo rm -rf /usr/local/share/systemtap/
//删除之前安装的node
brew uninstall node
//重新安装
brew install node

1 Ruby系列文章之6 —OS X 10.8.1 系统 HomeBrew的安装和简单使用
2 Mac上Homebrew的使用 (Homebrew 使 OS X 更完整)
3 mac 下安装node.js

你可能感兴趣的:(插件)