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