Get going with Node.js, npm and Vue.js 2 on Red Hat & Oracle Linux

Lucas Jellema 1
0 0
Read Time:1 Minute, 43 Second

A quick and rough guide on getting going with Node, npm and Vue.js 2 on a Enterprise Linux platform (Oracle Linux based on RedHat Linux)

Install Node.JS on a Oracle Enterprise Linux system:

 

as root:

curl –silent –location https://rpm.nodesource.com/setup_8.x | bash –

and:

yum -y install nodejs

(in order to disable the inaccessible proxy server that was setup for my yum environment I have to remove the line in /etc/yum.conf with proxy server)

(see instruction at: https://nodejs.org/en/download/package-manager/)

image

 

For Vue.js

See: https://vuejs.org/v2/guide/installation.html

still as root:

npm install vue

npm install --global vue-cli

 

Now again as the [normal] development user:

create and run your first Vue.js application

A single HTML document that loads Vue.js library and contains Vue.js “application” – and that can be opened like that in a local browser (no web server required)

vue init simple my-first-app

image

image

image

image

 

# create a new project using the “webpack” template

vue init webpack my-second-app

image

 

# install dependencies and go!

cd my-second-app

npm install

npm run dev

image

Open the generated Vue.js application in the local browser – or in a remote one:

image

 

Optional – though recommended – is the installation of a nice code editor. One that is to my liking is Microsoft Visual Studio Code – free, light weight, available on all platforms. See for installation instructions: https://code.visualstudio.com/docs/setup/linux

To turn the application – simplistic as it is – into a shippable, deployable application, we can use the build feature of webpack:

npm run build

image

The built resources are in the /dist folder of the project. These resources can be shipped and placed on any web server, such as nginx, Apache, Node.js and even WebLogic (co-located with Java EE web application).

The build process can be configured through the file /build/webpack.prod.conf.js, for example to have the name of the application included in the name of the generated resources:

 

image

About Post Author

Lucas Jellema

Lucas Jellema, active in IT (and with Oracle) since 1994. Oracle ACE Director and Oracle Developer Champion. Solution architect and developer on diverse areas including SQL, JavaScript, Kubernetes & Docker, Machine Learning, Java, SOA and microservices, events in various shapes and forms and many other things. Author of the Oracle Press book Oracle SOA Suite 12c Handbook. Frequent presenter on user groups and community events and conferences such as JavaOne, Oracle Code, CodeOne, NLJUG JFall and Oracle OpenWorld.
Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

One thought on “Get going with Node.js, npm and Vue.js 2 on Red Hat & Oracle Linux

Comments are closed.

Next Post

Integrating Vue.js in ADF Faces 12c Web Application - using HTML5 style Document Import

Vue.js is a popular framework for developing rich client web applications, leveraging browsers for all they are worth. Vue.js has attracted a large number of developers that together have produced a large number of quite interesting reusable components. ADF Faces is itself a quite mature framework for the development of […]
%d bloggers like this: