Install the Oracle JET command-line interface

Introduction

This tutorial shows you how to use the Node.js development environment to install the Oracle JavaScript Extension Toolkit (Oracle JET) command-line interface.

You can use the Oracle JET command-line interface and Node.js to create and run Oracle JET web apps. Node.js is an open-source, cross-platform JavaScript runtime environment that executes JavaScript code without a web browser.

The Oracle JET command-line interface runs under the Node.js environment and executes Oracle JET tooling commands in the ojet-cli package.

Objectives

On completion of this tutorial, you will have set up an environment where you can develop Oracle JET apps.

Prerequisites

Your company’s proxy server URL and port number (if you operate within a corporate network)

Task 1: Update Node.js

  1. Open a terminal window as an administrator and check your Node.js version.

    $ node -v
    

    Your installed version of Node.js is displayed.

  2. If your Node.js version is earlier than the versions listed as maintenance or active LTS on the Releases page of the Nodejs.org website, download a newer LTS version. Go to the Nodejs.org website. Under LTS Version (Recommended for Most Users), download the installer for your system. In the Download dialog box, choose a location for the file and click Save. Run the downloaded installer as an administrator and follow the steps in the installation wizard to install Node.js.

Task 2: Install the Oracle JET Command-Line Interface

  1. Set up a proxy server if it’s required by your network.

    $ npm config set proxy proxy-server-URL:proxy-port
    $ npm config set https-proxy proxy-server-URL:proxy-port
    

    In the previous example, proxy-server-URL is your network’s proxy server and proxy-port is the port number of the server. For example, if your proxy server is http://proxy.example.com and your proxy port is 6500, then enter the following:

    $ npm config set proxy http://proxy.example.com:6500
    $ npm config set https-proxy http://proxy.example.com:6500
    
  2. Verify your proxy settings.

    $ npm config get proxy
    $ npm config get https-proxy
    
  3. If a null value is returned, then repeat the set proxy and set https-proxy commands with the correct proxy server information.

  4. Install the Oracle JET command-line interface.

    • For Windows, in a terminal window that you open as an administrator:
    $ npm install -g @oracle/ojet-cli
    
    • For Mac and Linux systems:
    $ sudo npm install -g @oracle/ojet-cli
    

    The installation process takes a few minutes. After the installation is completed, the Oracle JET command-line interface shows a summary of all changes.

Task 3: Verify the Oracle JET Command-Line Interface

  1. In the terminal window, verify that the installation succeeded.

    $ ojet help
    

    You should see the available Oracle JET commands. If a network error is reported, then repeat the set proxy and set https-proxy commands with the correct proxy server information.

  2. Verify that the version of the Oracle JET command-line interface is the latest available version.

    $ ojet --version
    

    If the latest available version of the Oracle JET command-line interface displays, then the installation is correct. If not, please reinstall by using the npm install command for your platform.

  3. Close the terminal window.

More Learning Resources

Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.

For product documentation, visit Oracle Help Center.