“node -v” shows wrong version after “brew upgrade

2019-04-07 05:15发布

I upgraded my version of Node.js with :> brew upgrade node which installed v5.3.0. But when I get the version of node with :> node -v it shows v0.10.29.

I tried :> brew link --overwrite node but that didn't work.

Brew has node linked to /usr/local/Cellar/node/0.10.29 so I went there and noticed that there are other versions of node including the version I want in /usr/local/Cellar/node/.

How do I tell brew to link node to /usr/local/Cellar/node/5.3.0 ?

2条回答
姐就是有狂的资本
2楼-- · 2019-04-07 05:33

I removed the other versions of node that I didn't want in /usr/local/Cellar/node/ and then ran :> brew unlink node && brew link node and it fixed the problem.

查看更多
爷、活的狠高调
3楼-- · 2019-04-07 05:38

Try to brew link --override node

Also see related question How to install latest version of Node using Brew.

查看更多
登录 后发表回答