Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get jenkins to use current npm version?

Tags:

A project I am on has a Jenkins server to which I don't have remote access.
The server admin has installed npm 5.8 using npm install -g npm.
Executing npm -v reports a version of 5.8.

However, during the Jenkins build process, npm -v reports a version of 5.6 which is the version that shipped with the installed version of NodeJS.

Can someone assist me in what I should be asking the admin to change?

like image 229
Devon Holcombe Avatar asked Apr 17 '18 18:04

Devon Holcombe


1 Answers

The admin should be able to install the Jenkins NodeJS Plugin which allows you to handle several different installations (in different versions) of NodeJS. This way you can address the version of NodeJS & npm you want to use from the Job configuration, as the correct folder is temporarily added to the PATH variable.

There is a walkthrough guide on the wiki page of the plugin.

like image 84
lobetdenherrn Avatar answered Oct 04 '22 14:10

lobetdenherrn