Simple tutorial on using Node. js in MacOS _ node. js

Source: Internet
Author: User
Tags install homebrew couchdb
This article mainly introduces how to use Node in MacOS. simple js tutorial, Node. js is a framework that allows JavaScript applications to run on the server. if you need JavaScript, you can refer to this article for a good Node. js introduction article great nodejs intro, which will give you a very convenient introduction to Node. js and CouchDB, and provide an instance to implement the REST service for performing the CRUD operation on bookmarks, using CouchDB as the database.

This article describes how to install and start using Node in Mac OS X. js. this process takes about 30 minutes. we will also install CouchDB and implement CouchDB-based REST APIs.

This document assumes that Git has been installed on your machine. if not, please refer to this article for installation.

Install node. js and npm

The simplest method is in node. on the official js website, go to the nodejs download section page and select the installation program under Mac. it will install Node on your machine. js and npm (node package manager ).
After the installation is successful, you can use the node and npm commands.

Install CouchDB

Because this article uses CouchDB to store objects, you also need to install CouchDB.

Installing CouchDB is a little troublesome, because we need to download the source code and then compile I. Before that, we need to install Homebrew. please execute the following command:

git clone https://github.com/mxcl/homebrew.gitcd homebrew/binbrew install autoconf automake libtoolbrew install couchdb


Note: a problem reported before CouchDB may prevent installation. to fix this problem, you must manually edit it ~ The/couch/homebrew/Library/Formula/couchdb. rb file is edited as follows:

The code is as follows:

Require 'formula'

Class Couchdb <Formula
Url 'http: // www.apache.org/dyn/closer.cgi? Path = couchdb/source/1.1.1/apache-couchdb-1.1.1.tar.gz'
Homepage "http://couchdb.apache.org /"
Md5 'cd126219b9cb69a4c521abd6960807a6'


Note that you need to delete the source in the url. The final modification result is as follows:

The code is as follows:

Require 'formula'

Class Couchdb <Formula
Url 'http: // www.apache.org/dyn/closer.cgi? Path = couchdb/1.1.1/apache-couchdb-1.1.1.tar.gz'
Homepage "http://couchdb.apache.org /"
Md5 'cd126219b9cb69a4c521abd6960807a6'

If the installation process is suspended, you need to terminate the CTRL-C and execute the following command to try again:

The code is as follows:

./Brew install-v couchdb

Related Article

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.