node. js "2" Development environment Setup (Windows, linux& MAC)

Source: Internet
Author: User

There are a lot of installation methods, the following is just a way I like, the installation path does not have to be the same as me.
Now the latest version number is v0.10.28

Windows


1, download (Put to E:\node\nodejs):

Http://nodejs.org/dist/latest/x64/node.exe
Http://nodejs.org/dist/npm/npm-1.4.9.zip

2, unzip (to the current folder): Npm-1.4.9.zip

3. Environment variables:
Path inside add?: E:\node\nodejs

4. Change NPM configuration:
C:\USERS\CDZ\.NPMRC This file enter the following content
Userconfig = E:\NODE\NODEJS\NODE_MODULES\NPM\.NPMRC
TMP = E:\node\npm-tmp
prefix = E:\node\npm-global
cache = E:\node\npm-cache
Init-module = E:\node\nodejs\node_modules\npm\.npm-init.js

Linux & Mac


1, download (Put to/users/cdz/dev_soft_installed):

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

2. Decompression command:
Tar zxvf node-v0.10.28.tar.gz

3, enter the folder after decompression:
CD node

4. Environment configuration:
./configure [--prefix= "installation Folder"]

5. Compiling
Make

6. Installation
[sudo] make install

7. Set Environment variables:
Add the following to the ~/.bash_profile file:
#set for Nodejs
Export Node_home=/users/cdz/dev_soft_installed/node
Export path= $NODE _home/bin: $PATH

Export node_path= $NODE _home/lib/node_modules: $PATH



2014.6.21 Update (Allow node under Mac to be fully controllable)


1, to the official website to download the package that you see.


2, in the local establishment of the corresponding directory structure, the download after the extracted directory files copied to the Nodejs directory below, the specific operation to see.


3, environment variable settings, in the ~/.bash_profile file to add, for example, the following content.
#set for Nodejs
Export Node_home=/users/cdz/dev_soft_installed/node/nodejs
Export Node_path=/users/cdz/dev_soft_installed/node/npm-global/lib/node_modules
Export Npm_config_prefix=/users/cdz/dev_soft_installed/node/npm-global
Export Npm_config_cache=/users/cdz/dev_soft_installed/node/npm-cache
Export Npm_config_tmp=/users/cdz/dev_soft_installed/node/npm-tmp
Export path= $PATH: $NODE _home/bin: $NPM _config_prefix/bin


#alias for CNPM
Alias cnpm= "NPM--registry=http://r.cnpmjs.org \
--disturl=http://cnpmjs.org/dist "


Not explained.


Document Information

    • Copyright Disclaimer: Free Reprint-Non-commercial-non-derivative-retain attribution | Creative Commons by-nc-nd 3.0
    • Original URL: http://blog.csdn.net/cdztop/article/details/28224047
    • Last modified: June 21, 2014 17:10

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.