Linux under Nodejs installation (full details)
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.
Watch out for what files you download!!! The corresponding installation method is different Ah, pro.
(a) Compiled files
Simply said that after decompression, in the Bin folder already exist node and NPM, if you go into the corresponding file in the execution of the command line a bit of a problem is not, but not the overall, so set this as the global good.
| 123 |
cd node-v0.10.28-linux-x64/binls./node -v |
This will be completed, the node folder where the specific, what is the name of whatever you decide. Then set the global:
Here/home/kun/mysofltware/this path is your own, you will extract node files to where is.
(ii) compiling by source code
This way you download the file is source code, I don't like this way very much ... It's mainly trouble.
| 1234567891011 |
# tar xvf node-v0.10.28.tar.gz # cd node-v0.10.28 # ./configure # make # make install # cp /usr/local/bin/node /usr/sbin/ 查看当前安装的Node的版本 # node -v v0.10.28 |
(iii) Ubuntu environment/centos Environment Yum
There is also a shell hint of the apt-get way, I was this way before the pit ... Strongly not recommended.
| 12 |
sudo apt-get install nodejssudo apt-get install npm |
When you're done, you'll find that the node command works, and the Nodejs command can be used ...
Yum-y Install Nodejs.x86_64nodejs-v
Nodejs installation, Linux environment