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/bin ls ./node -v |
This will be completed, the node folder where the specific, what is the name of whatever you decide. Then set the global:
12 |
ln -s /home/kun/mysofltware/node-v0.10.28-linux-x64/bin/node /usr/local/bin/node ln -s /home/kun/mysofltware/node-v0.10.28-linux-x64/bin/npm /usr/local/bin/npm |
Here/home/kun/mysofltware/this path is your own, you will extract node files to where is.
1. Use xz-d node.tar.xz to extract the Node.tar file (no xz-d command required to install XZ execution: Yum install XZ installation XZ)
2. Unpack with TAR-XVF Node.tar
3. Set the global
ln -s /home/kun/mysofltware/node-v0.10.28-linux-x64/bin/node /usr/local/bin/node
ln -s /home/kun/mysofltware/node-v0.10.28-linux-x64/bin/npm /usr/local/bin/npm
4. Check that the configuration is correct
Node-v
Npm-v
Linux under Nodejs installation (full details)