Installation of Ubuntu Nodejs and NPM __js

Source: Internet
Author: User
Tags curl

A. Nodejs installation

1. Download Nodejs source code, this is currently the latest version

Http://nodejs.org/dist/v0.10.24/node-v0.10.24.tar.gz

First ensure that the system is installed to python,gcc,g++, if not installed:

$ sudo apt-get install python

$ sudo apt-get install build-essential

$ sudo apt-get install gcc

$ sudo apt-get install g++

2. Unpack the installation package

TAR-ZXF node-v0.10.24.tar.gz
CD node-v0.10.22/

3. Compile and install

/configure–prefix=/opt/nodejs #这里可以不指定目录, direct execution./configure commands are also available.
Make #这里有些慢, need to wait patiently
Make install

4, test installation

Enter node--version test was installed successfully, if the display version number indicates successful installation, the following node-related parameters

anwj@anwj:~/nodejs$ node--help
Usage:node [Options] [e-script | script.js] [arguments]
Node debug script.js [arguments]


Options:
-V,--version print node ' s version
-E,--eval script evaluate script
-P,--print evaluate script and print result
-I,--interactive always enter the REPL even if stdin
Does not appear to be a terminal
--no-deprecation Silence deprecation warnings
--trace-deprecation show stack traces on deprecations
--v8-options Print V8 command line options
--max-stack-size=val set max V8 stack size (bytes)


Two, NPM (Node Package manager)

You only need to execute the following command:
1.curl http://npmjs.org/install.sh | Sh

If there is a permission problem during the installation, you need to execute the above statement under root, or use sudo.
Curl Http://npmjs.org/install.sh | sudo sh
2 other installation methods, such as obtaining the newest branch of npm from Git, refer to the instructions on the http://npmjs.org/doc/README.html.

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.