We will discuss how to build a Node.js and React application on Jenkins using the Freestyle Project in this article.

Install Jenkins

Please read this article if Jenkins is not installed on your computer.

Jenkins must be configured with NodeJS after being set up.

Installing NodeJS plugin

Manage Jenkins > Plugin Manager > Install NodeJS plugin to launch Jenkins.

Tool configuration global

Go to Manage Jenkins > Global Tool Configuration > NodeJS to launch Jenkins.

Choose a node version that is compatible. We can configure several NodeJS versions for various applications.

  1. Create an application ad hoc.

An application job for Node

Open Jenkins > New Item > Enter any job name> Choose Freestyle Project > Click on Save button.

  1. Source Code Administration Verify Git and provide the repository URL:

  1. Build Environment > Provide Node & npm bin/ folder to PATH

Choose the Nodejs release that works with your application.

Installing NodeJS will show all versions that have been installed via Manage Jenkins > Global Tool Configuration > NodeJS.

  1. Build > Execute shell:

Here I’m using webpack for my NodeJS application build tool but you can use Gulp, Grunt, Webpack,Express.js, pm2, Babel Any tool that you want to use.

Do you want to create CI/CD pipeline using Jenkins for Nodejs Application? Contact with us today as we have a great team to build all software development solutions. Nettyfy Technologies is here to come up with all the solutions with our best services.