Ubuntu Installation Nodejs

Source: Internet
Author: User

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

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.