美文网首页
AWS EC2 上手动安装nodejs

AWS EC2 上手动安装nodejs

作者: jackli0855 | 来源:发表于2017-03-10 16:37 被阅读0次
  • switch to root user after ssh login
sudo -s
  • Installed nvm in /opt/nvm
git clone https://github.com/creationix/nvm.git /opt/nvm
  • Created the directory /usr/local/nvm. This is where the downloads will go ($NVM_DIR)
mkdir /usr/local/nvm
  • Create the directory /usr/local/node. This is where the NPM global stuff will go:
mkdir /usr/local/node
  • Created a file called nvm.sh in /etc/profile.d with the following contents:
export NVM_DIR=/usr/local/nvm
source /opt/nvm/nvm.sh

export NPM_CONFIG_PREFIX=/usr/local/node
export PATH="/usr/local/node/bin:$PATH"
  • make nvm is available to me
source /etc/profile.d/nvm.sh
  • Re-login to a shell session, then set the default node version.
nvm install node

相关文章

网友评论

      本文标题:AWS EC2 上手动安装nodejs

      本文链接:https://www.haomeiwen.com/subject/elcogttx.html