简体   繁体   English

使用自制程序问题安装Node.js.

[英]Installing Node.js with homebrew issue

I'm trying to install Node.js with homebrew on OS X but I'm running into a few issues and I'm not quite sure how to fix them. 我正在尝试在OS X上安装带有自制程序的Node.js,但是我遇到了一些问题而且我不太确定如何修复它们。 When I run brew doctor I get the following output: 当我运行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!

I tried to run brew link node and got the following message: 我试图运行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

So then I tried to run brew link --overwrite node and got the following error: 所以然后我尝试运行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

I am now stuck and not really sure what to do. 我现在卡住了,不知道该怎么做。 Any help would be greatly appreciated. 任何帮助将不胜感激。

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

sudo chown -R `whoami` /usr/local

To resolve the permission issue try 要解决权限问题,请尝试

sudo brew link --overwrite node

Note that unless you have specific reasons to install node using homebrew, I would recommend to just go to http://nodejs.org/ , download the Mac OS installer and let it do everything for you. 请注意,除非您有特定的理由使用自制软件安装节点,否则我建议您只需访问http://nodejs.org/ ,下载Mac OS安装程序并让它为您完成所有操作。

I'm a little late to the party but I'm having the same issue- I think I'm onto something though. 我有点迟到了,但是我遇到了同样的问题 - 我想我已经做了一些事情。

Check your permissions on /usr/local/lib/dtrace/node.d by running ls -al /usr/local/lib/dtrace/node.d . 通过运行ls -al /usr/local/lib/dtrace/node.d检查您对/usr/local/lib/dtrace/node.d的权限。 If the owner is someone other than your username, fix that by running 如果所有者是您的用户名以外的其他人,请通过运行来修复该问题

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

This should give you the permissions you need to proceed. 这应该为您提供继续操作所需的权限。 After that, I hit a few more directories that had owners listed as nobody (I actually ended up chowning all of /usr/local/Cellar, I'll wait for comments to see how bad of an idea that was). 在那之后,我点击了几个拥有所有者列为nobody目录(我实际上最终知道所有/ usr / local / Cellar,我会等待评论,看看有多糟糕的想法)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM