无法在 Homebrew 中 link/run Node.js v6

Unable to link/run Node.js v6 in Homebrew

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

在新的 MacBook 运行ning Sierra 上,我 运行: 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.

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

不要使用 Homebrew 安装 node。

我喜欢 Node Version Manager (NVM), and there is n (as mentioned by @ntalbs in the comments). These are better options on a Mac for node, to avoid certain. issues. later.

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