Install Nodejs (binary package) under Linux

Source: Internet
Author: User

In order to save trouble, I do not choose the source package compiled installation Nodejs, the machine behind Ah, rely on more things.

PS: Before compiling and installing MySQL, installed 30 minutes, can not afford to hurt ... Oh.

Back to the point: I chose to install a binary package

I am also a beginner, at first I do not know what is the binary package what is the source package, thought "***.tar.gz", are the source package,

After the download is unpacked, knock:./configure found no such thing.

After some understanding, the binary is not configure or makefile files, is compiled well. (If I understand wrong, please shoot bricks, I will change)

Here's the shell code:

#!/bin/sh## installation nodejs## Yepo 2016-07-28export path=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/ binclearprintf "###################### #Install nodejs######################" #下载NodeJS二进制包nodeVersion =v0.12.15# wget https://nodejs.org/download/release/$nodeVersion/node-$nodeVersion-linux-x64.tar.gz# move to the specified directory srcdir=/usr/ local/src# Transfer packet mv node-$nodeVersion-linux-x64.tar.gz $srcDir # Go to the Directory CD $srcDir # unpack the package tar xzf $srcDir/node-$ nodeversion-linux-x64.tar.gz# renamed, this looks like the MV node-$nodeVersion-linux-x64/node/#放到指定目录mv node. /#把可执行的两个程序放到/usr/local/bincd/usr/local/node/binmv node/usr/local/bin# Remove this soft connection rm-rf npm# go to/usr/local/ Bin create a soft connection for NPM cd/usr/local/binln-s/usr/local/node/lib/node_modules/npm/cli.js npm# Check installation iscompleted=0node-v >/dev /null 2>&1iscompleted=$?npm Help >/dev/null 2>&1iscompleted=$?if ["$isCompleted" = = "0"];then        echo "OK" else        echo "Error" fi

Original articles, welcome to reprint, Welcome to Exchange!!!

Install Nodejs (binary package) under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.