Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

1. Getting Node Set Up > Node and NPM

Node and NPM

There are numerous ways to install Node itself, depending on your environment. The easiest option is to download one of the installers available for Windows or Mac from the Node website (these include npm, as well). You can also install it in one line using Homebrew or the Advance Packaging Tool. On any supported operating system, if you have Git installed, you can clone Node directly from the repository and build it yourself.

Since it’s fairly universal, let’s look at getting Node from GitHub. This assumes that Git is already installed and available.

$ git clone git://github.com/joyent/node.git
$ cd node
$ git checkout v0.6.6
$ ./configure
$ make
$ make install

All we’re doing is cloning the GitHub repository, running a configuration script, and then building and installing Node. Pay special attention to the third line, though, because we’re also switching to the branch containing the most recent stable version of Node. That changes frequently, so if you decide to install from the command line, check the Node.js website first to find out what the current stable version is, or use git tag to list available versions.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint