I'm using Mac OS X Lion 10.7, and installed homebrew
with alternate install at custom path to keep it user scope requiring no sudo
.
I installed node.js
successfully. But npm
is not being installed.
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$
I see the path to the binary to node
is added to $PATH
variable. I don't know why npm
complains. How can I make it to be installed?
I got the answer from Stackoverlow/Unix & Linux site.
The core problem was the system doesn't expand ~
home directory symbol. So I had to put the absolute directory using $HOME
environment variable.