Compile and install Node. js in Ubuntu

Source: Internet
Author: User

Compile and install Node. js in Ubuntu

Download the latest compressed package from the node. js website and decompress it to the/opt directory.

Node. js details: click here
Node. js: click here

After installing GCC, run./configure

Root @ html5viewer1:/opt/node-v0.10.20 #./configure
{'Target _ defaults': {'cflags ': [],
'Default _ configuration': 'release ',
'Defines': [],
'Include _ dirs': [],
'Libraries': []},
'Variables ': {'clang': 0,
'Gcc _ version': 48,
'Host _ arch ': 'x64 ',
'Node _ install_npm ': 'true ',
'Node _ prefix ':'',
'Node _ shared_cares ': 'false ',
'Node _ shared_http_parser ': 'false ',
'Node _ shared_libuv': 'false ',
'Node _ shared_openssl ': 'false ',
'Node _ shared_v8 ': 'false ',
'Node _ shared_zlib ': 'false ',
'Node _ tag ':'',
'Node _ unsafe_optimizations ': 0,
'Node _ use_dtrace ': 'false ',
'Node _ use_etw': 'false ',
'Node _ use_openssl ': 'true ',
'Node _ use_perfctr ': 'false ',
'Node _ use_systemtap ': 'false ',
'Python': '/usr/bin/python ',
'Target _ arch ': 'x64 ',
'V8 _ enable_gdbjit ': 0,
'V8 _ no_strict_aliasing ': 1,
'V8 _ use_snapshot ': 'true '}}
Creating./config. gypi
Creating./config. mk
Root @ html5viewer1:/opt/

Then start compilation. After installation, I run these commands under the root user.

Make
...
Make install

Finally, the node executable program is installed in the/usr/local/bin directory, and npm is installed in the/usr/local/lib/node_modules directory.

You can run make test for testing.

Recommended reading:

Getting started with Node. Js [PDF + related Code]

Install and configure Node. js

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.