gulp command not recognized in Jenkins

2019-07-24 17:07发布

问题:

I've installed gulp and it works well in my cmd. So when I'm trying the gulp commands they work well. So I'm going to this path in my cmd:

C:\Program Files (x86)\Jenkins\workspace\project1

And I can run gulp (its a github project on my Jenkins). But when I'm working on my project1 in Jenkins itself (localhost), the gulp commands aren't recognized. Jenkins doesn't know gulp.

How do I have to integrate gulp in Jenkins? So my Jenkins will know its commands. I read something about node.js and its pluging. I also read something about a frontend-maven-plugin/ but it isn't clear at all.

回答1:

You need to add the gulp path for Jenkins so it knows where the command resides.

Manage Jenkins-->Configure System-->Global Properties:



回答2:

If you have gulp defined as your project's dependency then you can also use it directly:

node_modules\.bin\gulp mytask