【问题标题】:Installing Node.js with homebrew issue安装带有自制程序问题的 Node.js
【发布时间】:2014-03-10 20:06:41
【问题描述】:

我正在尝试在 OS X 上使用 homebrew 安装 Node.js,但遇到了一些问题,我不太确定如何解决它们。当我运行brew doctor 时,我得到以下输出:

Warning: Python is installed at /Library/Frameworks/Python.framework

Homebrew only supports building against the System-provided Python or a
brewed Python. In particular, Pythons installed to /Library can interfere
with other software installs.

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: You have uncommitted modifications to Homebrew
If this a surprise to you, then you should stash these modifications.
Stashing returns Homebrew to a pristine state but can be undone
should you later need to do so for some reason.
    cd /usr/local/Library && git stash && git clean -d -f
Error: Homebrew doesn't know what compiler versions ship with your version
of Xcode (5.1). Please `brew update` and if that doesn't help, file
an issue with the output of `brew --config`:
  https://github.com/Homebrew/homebrew/issues

Note that we only track stable, released versions of Xcode.

Thanks!

我尝试运行 brew link node 并收到以下消息:

Linking /usr/local/Cellar/node/0.10.26... Warning: Could not link node. Unlinking...

Error: Could not symlink file: /usr/local/Cellar/node/0.10.26/lib/dtrace/node.d
Target /usr/local/lib/dtrace/node.d already exists. You may need to delete it.
To force the link and overwrite all other conflicting files, do:
  brew link --overwrite formula_name

To list all files that would be deleted:
  brew link --overwrite --dry-run formula_name

然后我尝试运行brew link --overwrite node 并得到以下错误:

Linking /usr/local/Cellar/node/0.10.26... Warning: Could not link node. Unlinking...

Error: Permission denied - /usr/local/lib/dtrace/node.d

我现在卡住了,不知道该怎么办。任何帮助将不胜感激。

【问题讨论】:

    标签: node.js homebrew


    【解决方案1】:

    我通过运行解决了这个问题:

    sudo chown -R `whoami` /usr/local
    

    【讨论】:

      【解决方案2】:

      要解决权限问题,请尝试

      sudo brew link --overwrite node
      

      请注意,除非您有特殊原因使用自制软件安装节点,否则我建议您前往http://nodejs.org/,下载 Mac OS 安装程序并让它为您完成所有工作。

      【讨论】:

      • 这对我不起作用。它返回了这种类型的错误:“错误:懦弱地拒绝sudo brew link 您可以将 brew 与 sudo 一起使用,但前提是 brew 可执行文件由 root 拥有。但是,这既不推荐也不完全不支持,因此请自行执行风险。”我猜我的 brew 不属于 root。
      【解决方案3】:

      我参加聚会有点晚了,但我也遇到了同样的问题——不过我想我已经解决了。

      通过运行 ls -al /usr/local/lib/dtrace/node.d 检查您对 /usr/local/lib/dtrace/node.d 的权限。如果所有者不是您的用户名,请通过运行修复它

      sudo chown -R $USER:staff /usr/local/lib/dtrace/node.d
      

      这应该会为您提供继续操作所需的权限。在那之后,我又点击了几个拥有者列为nobody 的目录(我实际上最终把所有的 /usr/local/Cellar 都吃光了,我会等待 cmets 看看这是多么糟糕的想法)。

      【讨论】:

        猜你喜欢
        • 2019-02-11
        • 2017-10-26
        • 2011-08-21
        • 2011-06-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-04-30
        • 2018-06-13
        相关资源
        最近更新 更多