Home > Blockchain >  Jenkins on ec2 not recognizing composer or npm - both are installed
Jenkins on ec2 not recognizing composer or npm - both are installed

Time:09-22

I've installed Jenkins on an Amazon ec2 instance according to the instructions here https://www.jenkins.io/doc/book/installing/linux/#red-hat-centos and when I try to run a job that has an execute shell command step that does "composer install" or "npm install" it isn't recognizing either command. However from the terminal (as ec2-user) I can run both. Is there something I need to do to let Jenkins know where to find these commands?

CodePudding user response:

I just realized I can sudo su jenkins and install composer as that user.

For NPM, this article helped. You need to install the nodejs plugin, restart Jenkins, then in the build environment section of the configuration of your job, choose "Provide Node & npm bin/ folder to PATH".

I was still having problems running ng commands - after installing the ng client as the jenkins user. This post helped - which says to add "npm run" before ng.

I hope this helps someone. Especially since I figured it out moments after offering my bounty!

  • Related