Nodejs compile and install, NPM Global installation module

Source: Internet
Author: User

Nodejs official website: Download Nodejs source

Nodejs Chinese Community

Node Packaged Modules

A POSIX system that compiles node. js requires three tools:

    1. c++ compiler gcc or CLANG/LLVM


    2. python2.5 , does not support python3


    3. libssl-dev provides ssl/tls Encryption supports

Download Source Bundle:node-v0.10.29.tar.gz

Tar zxvf node-v0.10.29.tar.gzcd node-v0.10.29./configuremakesudo make install

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/40/DF/wKioL1PPjSvhOoTMAAB5lOFgmR8587.jpg "title=" 2014-07-23 18:18:23 screen. png "alt=" wkiol1ppjsvhootmaab5lofgmr8587.jpg "/>

Global (-G) Installation Module Express

$ sudo npm install-g express$ sudo npm install-g express-generator

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/40/E0/wKiom1PPjLvDRMzmAAA3bgLYvYk919.jpg "title=" 2014-07-23 18:21:29 screen. png "alt=" wkiom1ppjlvdrmzmaaa3bglyvyk919.jpg "/> A brief introduction to several NPM commands:

NPM list– View the currently installed modules

NPM version– View the current NPM version

NPM install– Installing a new module

NPM update– Update Module


NPM Config

NPM Config set proxy http://localhost:portnumber

NPM Config Set Registry http://registry.npmjs.org/


The NPM install module failed to get the contents of the repository.

The solution at the time was:! Turn off proxy settings instead!

Remove ~/.NPMRC in proxy configuration

NPM Config set proxy http://localhost:portnumber


A simple example:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/40/E1/wKiom1PPj3zBY5VrAAKusooeOjI441.jpg "style=" float: none; "title=" Nodejs1.png "alt=" Wkiom1ppj3zby5vraakusooeoji441.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/40/E1/wKioL1PPkJbSdf6pAAB4u_TS6Ew632.jpg "style=" float: none; "title=" Nodejs2.png "alt=" Wkiol1ppkjbsdf6paab4u_ts6ew632.jpg "/>

Recommended Reference Links:

Node China API documentation

Seven days Learn Nodejs


PS: Install Nodejs compilation to local directory

$tar zxvf node-v0.10.29.tar.gz$cd node-v0.10.29$mkdir ~/local$./configure–prefix=~/local$make$make install$vim. BASHRC Adding environment variables

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/40/E2/wKioL1PPkS6zzpPsAABF4N-uSgI364.jpg "title=" Nodejs3.png "alt=" Wkiol1ppks6zzppsaabf4n-usgi364.jpg "/>

This article is from "Whispering Autumn Wind" blog, please be sure to keep this source http://xjhznick.blog.51cto.com/3608584/1528426

Nodejs compile and install, NPM Global installation module

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.