无法在Homebrew中链接/运行Node.js v6

Mar*_*rra 2 homebrew node.js

我正在尝试专门安装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
Run Code Online (Sandbox Code Playgroud)

如果我跑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吗?我不想跑任何我不确定的东西.

cla*_*lay 9

不要使用Homebrew来安装节点.

我喜欢节点版本管理器(NVM),并且有n(如评论中@ntalbs所述).这些是Mac上节点的更好选择,以避免确定.问题.以后.

请注意,您可以安装nvm,并n通过自制.(brew install nvmbrew install n).