We have a new wiki. The migration is not 100% complete. You can help out by moving pages across. This wiki will exist for as long as there are pages left.

The official documentation has moved to http://docs.couchdb.org — The transition is not 100% complete, but http://docs.couchdb.org should be seen as having the latest info. In some cases, the wiki still has some more or older info on certain topics inside CouchDB.

You need to be added to the ContributorsGroup to edit the wiki. But don't worry! Just email any Mailing List or grab us on IRC and let us know your user name.

Installing from sources

  1. Get one of the source tarballs from http://ftp.mozilla.org/pub/mozilla.org/js/ (1.7.0 or 1.8.0-rc1 will do).

  2. Unpack the tarball. Note that once extracted the source are in the directory "js", without the expected version suffix.
  3. Go to the js/src directory.
    cd js/src
  4. Build SpiderMonkey. There is no default Makefile, use Makefile.ref. The default build is debug, use BUILD_OPT=1 for an optimized build.

    make BUILD_OPT=1 -f Makefile.ref
  5. Install SpiderMonkey. Instead of "install" the target to use is "export". Instead of PREFIX the target directory is specified with JS_DIST.

    sudo make BUILD_OPT=1 JS_DIST=/usr/local -f Makefile.ref export

Notes when installing on OS X

Notes when installing on Linux

It would be best if you can install the SpiderMonkey libraries via your system's package management system, eg:

apt-get install libmozjs-dev


yum install js-devel

Warning: Yum may install an older version of SpiderMonkey (1.5) that doesn't work with CouchDB. If you see build errors related to JSOPTION_NATIVE_BRANCH_CALLBACK, you will need to build a newer version of SpiderMonkey as mentioned above.

However, if you need to install from source you should make sure spidermonkey's lib directory is in LD_LIBRARY_PATH:

export LD_LIBRARY_PATH=/usr/local/spidermonkey/lib

Or if this does not work for you, set the /lib and /include locations when running ./configure by using something similar to:

./configure --with-js-lib=/usr/local/spidermonkey/lib --with-js-include=/usr/local/spidermonkey/include

If you get a message like this during "yum install js-devel":

No package js-devel available.
Nothing to do

you may need to add a yum repository. Add rpmforge.repo in /etc/yum.repos.d containing:

# Name: RPMforge RPM Repository for Red Hat Enterprise 5 - dag
# URL: http://rpmforge.net/
name = Red Hat Enterprise $releasever - RPMforge.net - dag
baseurl = ftp://ftp.pbone.net/mirror/atrpms.net/el5-i386/atrpms/stable
enabled = 1
protect = 0
gpgcheck = 0

(Put "x86_64" instead of "i386" if when appropriate.)

Now run:

yum clean all
yum install js-devel

and you should be OK.

Installing on Linux for CouchDB versions >= 1.1

Directions adapted from:


  1. Add RPMForge repo as detailed above (for mercurial, a prerequisite of SpiderMonkey)

  2. Install SpiderMonkey prerequisites (copied from above link)

    yum install \
      cvs zip gcc-c++ glib2-devel gtk2-devel fontconfig-devel libnotify-devel \
      libIDL-devel alsa-lib-devel libXt-devel freetype-devel pkgconfig \
      dbus-glib-devel curl-devel autoconf213 xorg-x11-proto-devel libX11-devel \
      libXau-devel libXext-devel wireless-tools-devel glibc-static libstdc++-static yasm \
      mesa-libGL-devel esound-libs esound-devel ccache mercurial
  3. Download a version of SpiderMonkey >= 1.8.5 (CouchDB's ./configure script looks for mozjs185 to determine JS library existence)

    curl -L -O http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz
  4. Unpack SpiderMonkey

    tar xvf js185-1.0.0.tar.gz
    cd js-1.8.5/js/src
  5. Install. 'make install' is needed to move the final files into position, despite it being omitted from Mozilla's process
    make install
  6. Use the following ./configure line for CouchDB
    ./configure --with-erlang=/wherever/your/erlang/install/is --with-js-lib=/usr/local/lib/ --with-js-include=/usr/local/include/js/

Notes when installing on Android

Please see the Android-specific "installing from source" instructions. Since support for Android was added fairly recently to Spidermonkey and NSPR, the above notes won't be of much help to you.

Installing_SpiderMonkey (last edited 2011-11-23 14:32:25 by 62)