Sunday, November 19, 2017

How to Setup Node.js and Oracle JET on Oracle Linux

What if you want to develop Oracle JET in Oracle Linux? Certainly this is possible - both Node.js and Oracle JET run on Oracle Linux or any other Linux distribution. If you follow Oracle JET Setup Guide, you will see Node.js is listed as prerequisite. But it may not be exactly straightforward to install Node.js on Oracle Linux. Below I will guide you through the steps.

Run command to install development tools to build native add-ons to be installed:

yum install -y gcc-c++ make


Enable Node.js yum repository:

curl -sL https://rpm.nodesource.com/setup_8.x | sudo -E bash -


Install Node.js:

sudo yum install nodejs


Verify if node and npm was installed successfully:


Next you can follow steps described in Oracle JET setup guide, all straightforward. Install Oracle JET:

sudo npm -g install @oracle/ojet-cli


Create new JET application with OJET utility:

sudo ojet create jetwinapp --template=navdrawer


Run application with OJET utility:

sudo ojet serve


JET application runs on Oracle Linux:

2 comments:

Anonymous said...

Hi Andrejus,

Do you have any idea about installing Oracle Jet on Windows.

I am able to install node.js and but when i execute the command ( npm -g install ojet-cli ) for installing jet it gives me error as below.

npm ERR! 403 Forbidden: ojet-cli@latest
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\atj\AppData\Roaming\npm-cache\_logs\2017-12-05T08_02_24_827Z-debug.log


8 silly fetchPackageMetaData error for @oracle/ojet-cli@latest 403 Forbidden: @oracle/ojet-cli@latest
9 verbose stack Error: 403 Forbidden: @oracle/ojet-cli@latest
9 verbose stack at fetch.then.res (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\lib\fetchers\registry\fetch.js:42:19)
9 verbose stack at tryCatcher (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
9 verbose stack at Promise._settlePromiseFromHandler (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:512:31)
9 verbose stack at Promise._settlePromise (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:569:18)
9 verbose stack at Promise._settlePromise0 (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:614:10)
9 verbose stack at Promise._settlePromises (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:693:18)
9 verbose stack at Async._drainQueue (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:133:16)
9 verbose stack at Async._drainQueues (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:143:10)
9 verbose stack at Immediate.Async.drainQueues (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:17:14)
9 verbose stack at runCallback (timers.js:789:20)

NOTE:
C:\Program Files\nodejs>npm -v
5.5.1

C:\Program Files\nodejs>node -v
v8.9.1

Appreciate your help.

Andrej Baranovskij said...

UPDATE:

Now Oracle provides stable builds of Node.js on Oracle Linux yum server:

http://yum.oracle.com/oracle-linux-nodejs.html

So, no need to use nodesource anymore.

Andrejus