Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Opa Application Development

You're reading from   Opa Application Development A rapid and secure web development framework to develop web applications quickly and easily in Opa

Arrow left icon
Product type Paperback
Published in Jun 2013
Publisher Packt
ISBN-13 9781782163749
Length 116 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Li Wenbo Li Wenbo
Author Profile Icon Li Wenbo
Li Wenbo
Arrow right icon
View More author details
Toc

Installing Opa


This section is about installation and configuration of Opa. You can get a more detailed installation guide that includes how to build Opa from source on Opa's webpage (https://github.com/MLstate/opalang/wiki/Getting-started). This section will give us brief instructions on how to install Opa compiler, Node.js, and some required modules for Node.js.

Installing Node.js

Node.js (http://nodejs.org) is a platform for building fast and scalable network applications. It is the backend of Opa (since Opa 1.0.0). We need to install Node.js first before installing Opa. The following are the steps to install Node.js on various operating systems:

  • Mac OS: Following are the steps to install Node.js:

    1. Download the latest .pkg package from http://nodejs.org/dist/latest/.

    2. Double-click on the package to install Node.js.

  • Ubuntu and Debian Linux: To install Node.js on Ubuntu and Debian Linux, type the following commands:

    $sudo apt-get install python-software-properties
    $sudo add-apt-repository ppa:chris-lea/node.js
    $sudo apt-get update
    $sudo apt-get install nodejs npm
    

    Tip

    Downloading the example code files

    You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

  • Windows: The following are the steps to install Node.js:

    1. Download the latest .msi package from http://nodejs.org/dist/latest/.

    2. Double-click on the package to install Node.js on Windows.

Type the following commands to confirm your installation. If everything goes right, you will see the version information of Node.js and npm.

$ node -v
$ npm –v

Installing the required modules

There are several modules that are required by Opa to run an application. Type the following command to install these modules:

$ npm install -g mongodb formidable nodemailer simplesmtp imap

Installing the Opa compiler

The easiest solution for installing Opa is to download an installer from the Opa website (http://opalang.org/). You can also get the installer from Opa's GitHub repository (https://github.com/MLstate/opalang/downloads). At the time this book is being written, the latest version of Opa is 1.1.0.

Following are the steps to install Opa on various operating systems:

  • Mac OS X: Download the latest .dmg package and double-click on it to install. You will need the password of an administrative account.

  • Ubuntu and Debian Linux: Download the latest .deb package and double-click on it to install. You can also install it with the following command line:

    $sudo dpkg –i opa-1.1.0.x86.deb
    
  • Windows: Download the latest .exe file and double-click on it to install. Note that only 64-bit packages are available for Windows at this time.

  • Other Linux: To install Opa follow these steps:

    1. Download the latest .run package for Linux.

    2. Go to the download folder and add an execution privilege to the downloaded file by running the following command:

      $ chmod a+x opa-1.1.0.x64.run
      
    3. Run the installing script:

      $ sudo ./opa-1.1.0.x64.run
      

Testing the installation

To test if Opa is installed properly on your computer, run the following command:

$ opa --version

Opa is installed properly if the version information of the Opa compiler is printed.

You have been reading a chapter from
Opa Application Development
Published in: Jun 2013
Publisher: Packt
ISBN-13: 9781782163749
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image