添加软链接

ln -s /home/ec2-user/app/nodejs/bin/npm /home/ec2-user
ln -s /home/ec2-user/app/nodejs/bin/node /home/ec2-user

修改用户环境变量文件
* 1.ls -a
* 2.vi .bash_profile 
* 3.PATH=$PATH:$HOME/ec2-user/app/nodejs/bin/npm:$HOME/ec2-user/app/nodejs/bin/node:---:/home/ec2-user/
* 4.source .bash_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/.local/bin:$HOME/bin
# PATH=$PATH:$HOME/ec2-user/app/nodejs/bin/npm:$HOME/ec2-user/app/nodejs/bin/node:---:$HOME/ec2-user

export NODE_HOME=$HOME/app/nodejs

export PATH=$PATH:$NODE_HOME/bin 

export NODE_PATH=$NODE_HOME/lib/node_modules

export PATH