Linux configuration Nodejs

Source: Internet
Author: User

http://my.oschina.net/blogshi/blog/260953

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.

?

1

2

3

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:

?

1

2

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.

(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.

?

1

2

3

4

5

6

7

8

9

10

11

# tar XVF node-v0.10.28.tar.gz

# CD node-v0.10.28

#./configure

# make

# make Install

# cp/usr/local/bin/node/usr/sbin/

View the version of node that is currently installed

# node-v

v0.10.28

(c) Apt-get

There is also a shell hint of the apt-get way, I was this way before the pit ... Strongly not recommended.

?

1

2

sudo apt-get install Nodejs

sudo apt-get install NPM

When you're done, you'll find that the node command works, and the Nodejs command can be used ...

Linux configuration Nodejs

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.