Previously installed under Windows and under the Mac node, it feels very convenient, not Chengxiang today installed Linux under the pit long time, hereby recorded.
First go to the official website to download the code, here must pay attention to the installation of two, one is source code code, one is compiled file. I just follow the online source installation method to operate the compiled files, the results of a long time.
(a) Compiled files
Like in the red box is already compiled the file, choose the appropriate version of the Linux download can, simply said is extracted, in the bin folder already exist node and NPM, if you go into the corresponding file in the execution command line a little problem, but not the overall, So it's good to set this to global by creating a soft link.
Tar XF node-v5.10.1-linux-x64.tar.gz-c/usr/local/cd/usr/local/mv node-v5.10.1-linux-x64/nodejs ln-s/usr/local/node Js/bin/node/usr/local/bin ln-s/usr/local/nodejs/bin/npm/usr/local/bin
(ii) compiling by source code
This way you download the file is source code, because my Linux version is 6.x, the default gcc-c++ is 4.4.7 version, and next come after the source code compilation requires gcc-c++ version of the minimum is 4.8, so I went to upgrade gcc-c++ version, As a result of the source code compiled upgrade gcc-c++, compiled for one hours, are not compiled to complete! Decisive by the pit ...
root>#./configure warning:c++ compiler too old, need g++ 4.8 or clang++ 3.4 (cxx=g++) creating./icu_config.gypi {' t Arget_defaults ': {' cflags ': [], ' default_configuration ': ' Release ', ' defines ': [], ' I Nclude_dirs ': [], ' libraries ': []}, ' variables ': {' Asan ': 0, ' gas_version ': ' 2.20 ', ' host_ Arch ': ' x64 ', ' Icu_small ': ' false ', ' node_byteorder ': ' Little ', ' node_install_npm ': ' true ', ' Node_prefix ': '/usr/local ', ' node_release_urlbase ': ', ' Node_shared_http_parser ': ' false ', ' Node_shared_libuv ': ' false ', ' Node_shared_openssl ': ' false ', ' node_shared_zlib ': ' false ', ' Node_tag ': ', ' node_use_dtrace ': ' false ', ' NODE_USE_ETW ': ' false ', ' node_use_lttng ': ' false ', ' Node_use_openssl ': ' true ', ' node_use_perfctr ': ' false ', ' openssl_fips ': ', ' OpenSSL _no_asm ': 0, ' tArget_arch ': ' x64 ', ' uv_parent_path ': '/deps/uv/', ' uv_use_dtrace ': ' false ', ' V8_enable_gdbjit ' : 0, ' V8_enable_i18n_support ': 0, ' v8_no_strict_aliasing ': 1, ' V8_optimized_debug ': 0, ' V8_random_seed ': 0, ' v8_use_snapshot ': ' true ', ' Want_separate_host_toolset ': 0}} creating./config.gyp I creating./config.mk warning:warnings were emitted in the Configure phase
(c) Apt-get
There is also a Ubuntu under the Apt-get way, I was this way before the pit
sudo apt-get install nodejs sudo apt-get install NPM
When you're done, you'll find that the node command doesn't work, and the Nodejs command can be used ...
The above is the whole content of this article, I hope that everyone's learning has helped, but also hope that we support topic.alibabacloud.com.