如何安装与安装在自定义path的自制程序安装的node.js npm?

我正在使用Mac OS X Lion 10.7,并在自定义path上安装了备用安装的homebrew ,以保持用户范围不需要sudo 。 我成功安装了node.jsnpm没有被安装。

 Last login: Tue Nov 29 10:26:51 on ttys003 Hoons-MacBook-Air:~ Eonil$ node --version v0.6.2 Hoons-MacBook-Air:~ Eonil$ node > (^C again to quit) > Hoons-MacBook-Air:~ Eonil$ curl http://npmjs.org/install.sh | sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 7184 100 7184 0 0 4581 0 0:00:01 0:00:01 --:--:-- 19363 npm cannot be installed without nodejs. Install node first, and then try again. Maybe node is installed, but not in the PATH? Note that running as sudo can change envs. PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:~/Unix/homebrew/bin Hoons-MacBook-Air:~ Eonil$ ls ~/Unix/homebrew/bin/ brew node node-waf Hoons-MacBook-Air:~ Eonil$ 

我看到二进制到node的path被添加到$PATHvariables。 我不知道为什么npm抱怨。 我怎样才能使它安装?

我从Stackoverlow / Unix&Linux站点得到了答案。

https://unix.stackexchange.com/questions/25605/how-to-add-home-directory-path-to-be-discovered-by-unix-which-command

核心问题是系统不扩展~目录符号。 所以我必须使用$HOME环境variables来放置绝对目录。

我不确定但是尝试像下面那样添加节点到/usr/local/bin

 ln -s /usr/local/bin/node ~/Unix/homebrew/bin/node 
Interesting Posts