如何用Homebrew的节点替换我的node版本?

时间:2019-09-26 00:59:03

标签: node.js macos homebrew

我已安装此版本的节点

localhost:pplsi.accounts davea$ node -v
v10.16.3
localhost:mydir davea$ which node
/usr/local/bin/node

我更喜欢使用自制版本,所以我尝试了

localhost:mydir davea$ brew upgrade node
Updating Homebrew...
Auto packing the repository in background for optimum performance.
See "git help gc" for manual housekeeping.
Auto packing the repository in background for optimum performance.
See "git help gc" for manual housekeeping.
==> Auto-updated Homebrew!
Updated 3 taps (phinze/cask, homebrew/core and homebrew/cask).
==> Updated Formulae
rabbitmq

Error: node 12.10.0 already installed

但是我的节点仍然显示为旧版本

localhost:pplsi.accounts davea$ node -v
v10.16.3

如何用已安装的自制软件替换节点?

1 个答案:

答案 0 :(得分:-1)

可能brew安装的节点不在路径中,将/ usr / local / bin文件夹添加到路径中并尝试。

export PATH="/usr/local/bin:$PATH"