2011-11-29 47 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 
相關問題