2011-11-29 79 views
4

我正在使用Mac OS X Lion 10.7,并安装了homebrew,并在自定义路径上进行了备用安装,以使其用户范围不需要sudo。 我成功安装了node.js。但npm未安装。如何在自定义路径中安装自制软件的情况下安装node.js的npm?

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变量。我不知道为什么npm抱怨。我怎样才能安装它?

回答

0

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

ln -s /usr/local/bin/node ~/Unix/homebrew/bin/node 
相关问题