【问题标题】:Unable to link/run Node.js v6 in Homebrew无法在 Homebrew 中链接/运行 Node.js v6
【发布时间】:2017-06-19 21:04:18
【问题描述】:

我正在尝试专门安装 Node.js v6,但事实证明这非常困难。

在运行 Sierra 的新 MacBook 上,我运行过: brew install node@6

这给了我:

Please note by default only English locale support is provided. If you need
full locale support you should either rebuild with full icu:
  `brew reinstall node --with-full-icu`
or add full icu data at runtime following:
  https://github.com/nodejs/node/wiki/Intl#using-and-customizing-the-small-icu-build

This formula is keg-only, which means it was not symlinked into /usr/local.

This is an alternate version of another formula.

If you need to have this software first in your PATH run:
  echo 'export PATH="/usr/local/opt/node@6/bin:$PATH"' >> ~/.zshrc

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/node@6/lib
    CPPFLAGS: -I/usr/local/opt/node@6/include


Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
????  /usr/local/Cellar/node@6/6.9.5: 3,891 files, 41.3M

如果我运行which node,我会得到node not found。如果我运行brew link node,我会得到Error: No such keg: /usr/local/Cellar/node。我也跑了sudo chown -R $USER /usr/local

如何“链接”Node.js v6 以便其他软件可以找到它?我运行echo 'export PATH="/usr/local/opt/node@6/bin:$PATH"' >> ~/.zshrc 吗?我不想运行任何我不确定的东西。

【问题讨论】:

标签: node.js homebrew


【解决方案1】:

不要使用 Homebrew 安装节点。

我喜欢Node Version Manager (NVM),还有n(正如@ntalbs 在cmets 中提到的那样)。这些是 Mac 上用于节点的更好选择,以避免certainissueslater.

注意,您可以通过 Homebrew 安装 nvmn。 (brew install nvmbrew install n)。

【讨论】:

  • 是的,我放弃并使用了n。我只是追求 Homebrew,因为它可以在另一台机器上运行(著名的遗言)。感谢您的提示
猜你喜欢
  • 1970-01-01
  • 2013-09-11
  • 2015-12-27
  • 2018-10-14
  • 1970-01-01
  • 1970-01-01
  • 2016-06-30
  • 2022-01-13
  • 2017-10-09
相关资源
最近更新 更多