Use Node.js 12 on Red Hat OpenShift today
On April 23, Node.js released its latest major version with Node.js 12. Because this is an even-numbered release, it will become a Long Term Support (LTS) release in October, code-named Erbium.
This release brings a host of improvements and features, which this blog post isn’t going to cover. Instead, I will focus on how to start using this new release today on Red Hat OpenShift. If you’re interested in more about the various improvements and new features, check out the articles listed at the end of this post.
The Nodeshift team creates and maintains Source-to-Image(S2I) container images for Node.js, and I’m happy to report that we have released Node.js 12.
Everything you need to grow your career.
With your free Red Hat Developer program membership, unlock our library of cheat sheets and ebooks on next-generation application development.SIGN UP
For those familiar with the process of using an S2I image, you keep doing what you do. But, for those who might be a little new to the process, here are a few quick examples of how to deploy an application using the Node.js 12 image.
First, you can use the
oc new-app command with a Git repo:
oc new-app nodeshift/centos7-s2i-nodejs:12.x~https://github.com/nodeshift-starters/nodejs-rest-http oc expose svc/nodejs-rest-http
Notice that we are specifying the 12.x tag.
Or, you can use the Nodeshift module to deploy a local directory:
npx nodeshift --imageTag=12.x --expose
Again, we are specifying the 12.x tag.
As you can see, using Node.js 12 on Red Hat OpenShift today is pretty simple.
As an extra bonus, for those developing web applications on Red Hat OpenShift, we have also released a Node.js 12 version of the Web App Builder Image.
To learn more about how to use that image, check out the “Modern web applications on OpenShift” article series:
- Modern web applications on OpenShift: Part 1 — Web apps in two commands
- Modern web applications on OpenShift: Part 2 — Using chained builds
- Modern web applications on OpenShift: Part 3 — Openshift as a development environment
To learn more about the improvements and features in Node.js 12, you can also check out the official Node.js blog post.