`

how to Installing Node and community add-ons

阅读更多

Node can either be installed using conventional application installers or by using the command line. Command-line installation is easy on OS X and Linux, but it’s not recommended for Windows.

 

A.1. OS X setup

The official installer provides an easy way to install a precompiled version of Node and npm.

Installation with Homebrew
//Install Homebrew by entering the following into the command line
ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"

//Install Node
brew install node

 

A.2. Windows setup

Node can be most easily installed on Windows by using the official standalone installer. After installing, you’ll be able to run Node and npm from the Windows command line. If you want install it by source code, you may need Cygwin to run Node. Cygwin’s package selector allows you to select open source software that will be installed on your system.

Cygwin packages needed to run Node
devel gcc4-g++
devel git
devel make
devel openssl-devel
devel pkg-config
devel zlib-devel
net inetutils
python python
web wget

 Once you’ve selected the packages, click Next. run Cygwin and compile Node.

 

A.3. Linux setup

there are other installation instructions on GitHub:

Ubuntu installation prerequisites
//Before installing Node on Ubuntu, you’ll need to install prerequisite packages. This is done on Ubuntu 11.04 or later using a single command:
sudo apt-get install build-essential libssl-dev

 

CentOS installation prerequisites
//Before installing Node on CentOS, you’ll need to install prerequisite packages. This is done on CentOS 5 using the following commands:
sudo yum groupinstall 'Development Tools'
sudo yum install openssl-devel

 

Compiling Node involves the same steps on all operating systems.

Compiling Node
//create a template file to download node source code
>mkdir tmp
>cd tmp
>curl -O http://nodejs.org/dist/node-latest.tar.gz
>tar zxvf node-latest.tar.gz
>ls
>cd node-v*
>./configure
>make
>sudo make install
>node -v

if you run Cygwin On Windows 7 or Vista,it maybe have errors。this is because of Cygwin.Just quit Cygwin enviroment,run ash.exe(c:\cygwin\bin\ash.exe), and enter /bin/rebaseall -v。then restart your computer.

 You should now have Node on your machine!

 

Using the Node Package Manager

The Node stack is composed of globally available functionality, core modules, and community-created modules.


npm is missing on my system
cd /tmp
git clone git://github.com/isaacs/npm.git
cd npm
sudo make install
npm -v

  

Searching for packages

//search for xml packages
npm search xml generator

 or you can use http://search.npmjs.org/  to search the info. The npm search website provides useful statistics on module popularity.

Installing packages
//installing the express package locally:
> npm install express
//installing the express package globally:
>npm install -g express
//or
>sudo npm install -g express

 

Exploring documentation and package code
//an example of viewing documentation for the express package:
>npm docs express
//explore the local express source code
>npm explore express
//explore the global express source code
>npm -g explore express

 

 

 

 

 

  • 大小: 16.9 KB
分享到:
评论

相关推荐

    Installing-Mumax-and-Gnuplot-in-Windows-10-Step-by-Step

    安装 Mumax 3.9.1 和 Gnuplot 5.2 在 Windows 10 中的步骤指南 在这篇文章中,我们将一步步指导用户安装 Mumax 3.9.1 和 Gnuplot 5.2 在 Windows 10 操作系统中。这篇文章将为用户提供详细的安装步骤和相关知识点,...

    edx-readthedocs-io-edx-installing-configuring-and-running-en-latest.pdf

    1. Open edX平台简介:文档中提到的“Installing, Configuring, and Running the Open edX Platform”是一个运行手册,该手册对如何安装、配置和运行Open edX平台提供了详尽的指导。Open edX平台支持各种在线教育...

    node-v9.11.1-x64

    Node.js 是一个基于 Chrome V8 引擎的 JavaScript 运行环境。Node.js 使用了一个事件驱动、非阻塞式 I/O 的模型,使其轻量又高效

    Installing-Studio-v6-1-Plugins

    ### 标题解读:“Installing-Studio-v6-1-Plugins” 标题“Installing-Studio-v6-1-Plugins”清晰地指出了本文的主题:安装 Zend Studio 的 v6.1 版本作为插件。这暗示了该过程是在一个已经存在的 Eclipse 集成开发...

    openwrt-nodejs

    此包是AR9331主控的Openwrt系统上运行的node所需要的两个包(uclibcxx_0.2.4-1_ar71xx及node_v0.10.17-2_ar71xx)...Installing node (v0.10.17-2) to root... Configuring node. root@OpenWrt:/tmp# node -v v0.10.17

    node-red-contrib-function-npm:节点红色功能节点,具有从npm安装软件包的能力

    节点红色贡献功能节点红色功能节点,具有从npm安装和使用软件包的能力相容性节点红色版本> 1.0安装从您的节点红色目录npm install node-red-contrib-function-npm用法function-npm节点的行为类似于普通功能节点,...

    How to Cheat at Securing a Wireless Network

    including Penetration Tester's Open Source Toolkit (ISBN: 1-5974490210), Stealing the Network: How to Own an Identity (ISBN: 1597490067), InfoSec Career Hacking (ISBN: 1597490113), and OS X for ...

    这是一组在气象等领域实用性很强的MATLAB程序包.rar

    In the Home menu of MATLAB, click Add-Ons, and search for Climate Data Toolbox. Click "Add from GitHub" and that's all you need to do. Installing this way is easy and will provide the most up-to-date ...

    Developing Drivers with the Microsoft Windows Driver Foundation

    Part 5 - Building, Installing, and Testing a WDF Driver Chapter 19 - How to Build WDF Drivers Chapter 20 - How to Install WDF Drivers Chapter 21 - Tools for Testing WDF Drivers Chapter 22 - ...

    junit in action 第2版 源码 part2

    2 Set the ANT_HOME environment variable to [ant_home] and add ANT_HOME\bin (or ANT_HOME/bin) to the PATH environment variable Installing Maven ---------------- 1 Download Maven from ...

    junit in action 第2版 源码 part6

    2 Set the ANT_HOME environment variable to [ant_home] and add ANT_HOME\bin (or ANT_HOME/bin) to the PATH environment variable Installing Maven ---------------- 1 Download Maven from ...

    junit in action 第2版源码 part1

    2 Set the ANT_HOME environment variable to [ant_home] and add ANT_HOME\bin (or ANT_HOME/bin) to the PATH environment variable Installing Maven ---------------- 1 Download Maven from ...

    junit in action第2版 源码 part5

    2 Set the ANT_HOME environment variable to [ant_home] and add ANT_HOME\bin (or ANT_HOME/bin) to the PATH environment variable Installing Maven ---------------- 1 Download Maven from ...

    junit in action 第2版 源码 part3

    2 Set the ANT_HOME environment variable to [ant_home] and add ANT_HOME\bin (or ANT_HOME/bin) to the PATH environment variable Installing Maven ---------------- 1 Download Maven from ...

    junit in action 第2版 源码 part4

    2 Set the ANT_HOME environment variable to [ant_home] and add ANT_HOME\bin (or ANT_HOME/bin) to the PATH environment variable Installing Maven ---------------- 1 Download Maven from ...

    installing-asterisk-from-source

    【安装Asterisk从源代码】 在进行VoIP通信时,Asterisk是一个非常重要的开源PBX(Private Branch eXchange)系统,它支持多种协议,如SIP、PJSIP和WebRTC。本文主要讲解如何从源代码编译并安装Asterisk。...

    Practical Node.js: Building Real-World Scalable Web Apps, 2nd Edition

    If you already know the basics of Node.js, now is the time to discover how to bring it to production level by leveraging its vast ecosystem of packages.With this book, you'll work with a varied ...

    Compaq Visual Fortran-Installing-&-Get-Started

    本资源为 Compaq Visual Fortran 6.5 版安装文件,包含电子安装教程及入门说明。可作为了解 Fortran 编程的入门参考资料。非印刷版资源,全英文描述,全文可检索,并附完整目录,方便查阅。

    python-3.6-book

    howto-argparse.pdf howto-clinic.pdf howto-cporting.pdf howto-curses.pdf howto-descriptor.pdf howto-functional.pdf howto-instrumentation.pdf howto-ipaddress.pdf howto-logging.pdf howto-logging-cookbook...

    node-v18.18.1.tar.gz

    Node.js,简称Node,是一个开源且跨平台的JavaScript运行时环境,它允许在浏览器外运行JavaScript代码。Node.js于2009年由Ryan Dahl创立,旨在创建高性能的Web服务器和网络应用程序。它基于Google Chrome的V8 ...

Global site tag (gtag.js) - Google Analytics