node-0.12.7_1已经安装,它只是没有链接

时间:2015-09-08 06:44:51

标签: node.js npm

所以,最近我检查了我的npm版本并收到了这条错误消息:

Yogies-MacBook-Pro:bin yogieputra$ node --version
v0.12.7
Yogies-MacBook-Pro:bin yogieputra$ npm --version
-bash: /usr/local/bin/npm: No such file or directory
Yogies-MacBook-Pro:bin yogieputra$ brew install npm
Warning: node-0.12.7_1 already installed, it's just not linked

任何人都知道如何解决这个问题?

2 个答案:

答案 0 :(得分:2)

运行brew link nodebrew doctor

您可能需要sudo sudo brew link node

答案 1 :(得分:1)

要链接已安装的节点,请运行以下命令:

brew link homebrew/versions/node012

有关详细说明,您可以浏览this