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