-
Download Node.js binaries
Node.js binaries are available at nodejs.org. You can download the more stable LTS version or Current version with the latest features.
-
Extract the download binary files
You can either first extract the binary files to a temporary directory, then copy them to the
/usr/localdirectory; or extract the files right into the/usr/localdirectory.-
Extract to temporary folder, and then copy the files to
/usr/localfolder.# cd temp # tar -xvJf ~/downloads/node-v7.2.0-linux-x64.tar.xz # cd node-v7.2.0-linux-x64 # sudo cp -R . /usr/local
-
Extract directly into the
/usr/localfolder. First change directory to/usr/local, and then issue thetarcommand.# sudo tar --strip-components=1 -xvJf ~/downloads/node-v7.2.0-linux-x64.tar.xz
-
Extract to temporary folder, and then copy the files to
-
Check Node.js installation
# node -v v7.2.0
-
Check npm installation
# npm version { npm: '3.10.9', ares: '1.10.1-DEV', cldr: '30.0.2', http_parser: '2.7.0', icu: '58.1', modules: '51', node: '7.2.0', openssl: '1.0.2j', tz: '2016g', unicode: '9.0', uv: '1.10.1', v8: '5.4.500.43' zlib: '1.2.8' }