CentOS 5/cPanel サーバーにルートとしてログインし、次のように入力しました。
cd /usr/local/bin/
git clone --depth 1 http://github.com/joyent/node.git
cd node
git checkout origin/v0.4 # optional. Note that master is unstable.
export JOBS=2 # optional, sets number of parallel commands.
mkdir ~/local
./configure --prefix=$HOME/local/node
make
make install
echo 'export PATH=$HOME/local/node/bin:$PATH' >> ~/.profile
source ~/.profile
インストールされていないため、サーバーからログアウトして再度ログインするまで、正常に動作しているようです。
[~]# node test.js
-bash: node: command not found
入力source ~/.profile
すると、ログアウトするまで再び機能し始めます。
助けてください。ありがとう。
編集:
これは私の .bash_profile の内容ですが、どうすれば変更できますか?
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME