Install Nodejs on Ubuntu
Step 1: Upgrade the system
to upgrade the system by following the command, and install some of the necessary packages for node. js.
[email protected]:~# apt-get update
[email protected]:~# apt-get install python gcc make g++
Step 2: Get the source code for node. JS
After installing the dependency package we can download the source code of node. JS from the official website and extract the commands as follows:
[email protected]:~# wget https:// nodejs.org/dist/node-v0.6.8.tar.gz
[email protected]:~# tar zxvf node-v0.6.8.tar.gz
Step 3: Start installation
LS view file
then enter the node-v0.6.8 folder
into the source directory, and then run the./configure file
Error:
Install node. js
on Ubuntu 10.10: run./configure
Error in git clone
CD node
./configure--prefix = $ home/local/node
Check OpenSSL: No check function found Ssl_library_init: Check head not found OpenSSL /crypto. h: Not found/home/andreas/software/node/wscript:340: Error: Unable to automatically detect OpenSSL support. Ensure that the OpenSSL development kit is installed. Use Configure--WITHOUT-SSL to disable this message.
Solution for me: Installing Libssl-devsudo apt-get install Libssl-dev
after I installed Libssl-dev, I rerun the node. js./configure script and "completed successfully"
Installation of the Nodejs when encountering the above problem, OpenSSL has been installed, but the./configure prompt cannot be detected, workaround as above
If after installing Libssl-dev, only missing the same, OpenSSL is not found, then install this
sudo apt-get install Libcurl4-openssl-dev
Step 4:nodejs Configuration
[Email protected]:~# ls
node-v0.12.4 node-v0.12.4.tar.gz
[Email protected]:~# cd node-v0.12.4/
[Email protected]:~/node-v0.12.4#./configure
[Email protected]:~/node-v0.12.4# make install
Post-Installation testing
[Email protected]:~/node-v0.12.4# node-v
v0.12.4
Create a file with a. js file extension and run it with the command of the node
[Email protected]:~/node-v0.12.4# Touch helo_test.js
[Email protected]:~/node-v0.12.4# vim helo_test.js//note Vim:command not found installation apt-get install vim
Console.log (' Hello world ');
Now we run the file with the command of the node
[Email protected]:~/node-v0.12.4# node Helo_test.js
Hello World
Ubuntu Installation Nodejs