gpt4 book ai didi

当我注销时 Node.js 停止工作

转载 作者:行者123 更新时间:2023-12-04 19:39:14 24 4
gpt4 key购买 nike

我以 root 身份登录到我的 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

最佳答案

When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable. The --noprofile option may be used when the shell is started to inhibit this behavior.



也许你有一个 .bash_profile而它正在被使用?

关于当我注销时 Node.js 停止工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6437936/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com