Hoang Subin
Hoang Subin

Reputation: 7430

Can I run multiple node version on Jenkins?

Currently I met one problem about Jenkins.

The ex-projects are using Angular 4 with node version 8.

The new project is using Angular 8 with node version 12.

Is there any way to config multiple node version on Jenkins?

Upvotes: 2

Views: 9087

Answers (3)

VonC
VonC

Reputation: 1326782

THe NodeJS plugin should allow you to declare multiple NodeJS installation in the global settings

https://wiki.jenkins.io/download/attachments/46334885/image2018-3-31%2016%3A40%3A29.png?version=1&modificationDate=1522507231000&api=v2

Upvotes: 4

6be709c0
6be709c0

Reputation: 8441

I recommend you to install nvm by default on your agents and edit the version you want to use by a simple command :

nvm use 12.4

Why?
Because installing a Jenkins plugin requires maintenance and I personally ended up with the above solution because it's more flexible and you have more control.

How to install nvm

Upvotes: 3

Kathak Dabhi
Kathak Dabhi

Reputation: 399

You can use Nvm Wrapper Plugin to manage Node version with diff projects. https://wiki.jenkins.io/display/JENKINS/Nvm+Wrapper+Plugin

Upvotes: 0

Related Questions