Use the NodeSource PPA. For details look at the installation instructions. First, choose the Node.js version you need and add the sources for it:
# for Node.js v4
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
# OR for Node.js v5
curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
# OR for Node.js v6
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
# OR for Node.js v7
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
Then install the Node.js package.
sudo apt-get install -y nodejs
P.S.: curl package must be installed on server for these code lines.
Upgrading
If you have nodejs already installed and want to update, then first remove current instalation and install it again using scripts above.
sudo apt-get purge nodejs npm
本文提供了Node.js不同版本在Linux环境下通过NodeSource PPA源安装的详细步骤,并介绍了如何进行版本升级,包括移除旧版本及重新安装新版本的过程。
5万+

被折叠的 条评论
为什么被折叠?



