Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

There are no Installations for NodeJS in Jenkins

Can't figure this out for quite a piece of time. Can't find answer on the web either.

My CI tool is Jenkins. Source of code is Git. A build trigger is another build stability. Plugin manager says that NodeJS is installed.

Now this above is building until I pick this build environment:

Provide Node & npm bin/ folder to PATH

(to use npm command) which shows me a dropdown list with Installations which has no Installations at all to choose from.

I can save this job and run it. In the output console I get:

ERROR: Build step failed with exception
java.lang.IllegalArgumentException: NodeJS Installation not found :

In global tool configuration there are no NodeJS installations. I guess this is the problem. Now, how can I know what Installation directory should I put there?

like image 633
Jacek Góraj Avatar asked Oct 06 '16 13:10

Jacek Góraj


People also ask

Where does Jenkins install Nodejs?

Configure cache Each time an executor request a new NodeJS installation after download the NodeJS archive it is stored on master node in JENKINS_HOME/caches/nodejs. This is done to speed up the installation on a Jenkins slaves (for example on ephemeral slaves in kubernetes) and reduce internet traffic.


Video Answer


1 Answers

Did you install and follow the instruction of the node.js plugin? It is quite straight forward:

  1. After installing the plugin, go to the global jenkins configuration panel (JENKINS_HOME/configure or JENKINS_HOME/configureTools if using jenkins 2), and add new NodeJS installations For every Nodejs installation, you can choose to install some global npm packages.
  2. Now, go to a job configuration screen, you will have 2 new items : On the "Build environnment" section, you will be able to pick one of the NodeJS installations to provide its bin/ folder to the PATH. This way, during shell build scripts, you will have some npm executables available to the command line (like bower or grunt)
like image 102
Stavros Zavrakas Avatar answered Sep 28 '22 06:09

Stavros Zavrakas