node.js - Node 已经安装,只是没有链接

标签 node.js macos homebrew

我尝试修复在运行 npm 时必须使用 sudo 的错误。我盲目地按照链接卸载 Node ,代码来自这个gist

运行命令后,我尝试使用 brew 重新安装它:brew install node。这给了我以下错误:

Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink share/doc/node/gdbinit
/usr/local/share/doc/node is not writable.

You can try again using:
  brew link node

尝试运行brew link node,我得到:

Linking /usr/local/Cellar/node/5.4.0... 
Error: Could not symlink share/systemtap/tapset/node.stp
/usr/local/share/systemtap/tapset is not writable.

然后当我写 brew install npm 时,我得到:

Warning: node-5.4.0 already installed, it's just not linked

当我写 npm -v 我得到:

env: node: No such file or directory

关于如何解决这个问题的任何想法?

最佳答案

我设法通过首先运行 sudo chown -R $USER/usr/local 并使用 brew link node 来解决此问题。现在我已经正确安装了 Node 。

关于node.js - Node 已经安装,只是没有链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35249204/

相关文章:

javascript - ui-select : expected expression, 得到了。 (观点)

javascript - 无法在 ng-view 内渲染 jade

mongodb - brew mongodb 社区 : can't connect to localhost database

ruby-on-rails - pg_dump 服务器版本不匹配

node.js - 将 Bing Web 搜索 API 与 QnA 聊天机器人集成

MySQL:如何忽略该列不明确

macos - 如何在 Mac 应用程序中显示和隐藏单个图像?

macos - 如何使用 Automator 将窗口置于最前面?

objective-c - 无法执行操作,因为 childrenKeyPath 为 nil

macos - 在 macos 上安装 Homebrew 时跳过命令行工具的安装