if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
我尝试了Stack Overflow上提供的四个解决方案,但是都失败了:
方案一,创建.bash_profile文件,并在其中添加:
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
失败。
方案二,创建.bash_profile文件,并在其中添加:
[ -f "$HOME/.bashrc" ] && ."$HOME/.bashrc"
失败。
方案三,创建.bash_profile文件并添加node的bin目录作为环境变量:
export PATH=/usr/local/node/bin:$PATH
失败。
方案四,在.profile文件中添加node的bin目录作为环境变量:
export PATH=/usr/local/node/bin:$PATH
失败。
跪求各位大佬指点我应该怎么解决这个问题,万分感谢!
注1:
系统环境:Debian 12。
桌面环境:Xfce 4.18。
注2:
我的.profile文件的内容是:
# ~/.profile: executed by Bourne-compatible login shells.
if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
mesg n 2> /dev/null || true
注3:
我的.bashrc文件的内容是:
# ~/.bashrc: executed by bash(1) for non-login shells.
# Note: PS1 and umask are already set in /etc/profile. You should not
# need this unless you want different defaults for root.
# PS1='${debian_chroot:+($debian_chroot)}\h:\w\$ '
# umask 022
# You may uncomment the following lines if you want `ls' to be colorized:
# export LS_OPTIONS='--color=auto'
# eval "$(dircolors)"
# alias ls='ls $LS_OPTIONS'
# alias ll='ls $LS_OPTIONS -l'
# alias l='ls $LS_OPTIONS -lA'
#
# Some more alias to avoid making mistakes:
# alias rm='rm -i'
# alias cp='cp -i'
# alias mv='mv -i'
export PATH=/usr/local/node/node-v18.16.1-linux-x64/bin:$PATH