Wednesday 7 June 2017

Jenkins build automation unable to run gulp commands script

I am trying to create a very simple build project in Jenkins. I have added only single build step as of now but its failing while running the build.

The step I have added is as follows:

enter image description here

This is only the NodeJS script step I wanted to run as of now. Once it succeed I will go ahead with full build steps.

I checked many SO question regarding this and have done all the necessary configurations like follows:

Already set Global Environment variable in Jenkins as:

enter image description here

And Global tool configuration like:

enter image description here

Still I am getting below error after running the build:

[workspace] $ node.exe C:\Windows\TEMP\hudson921629484097398968.js
module.js:471
    throw err;
    ^

Error: Cannot find module 'gulp'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Windows\TEMP\hudson921629484097398968.js:1:74)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
Build step 'Execute NodeJS script' marked build as failure
Finished: FAILURE

Note: I already tried executing npm install gulp@~3.9.1 command.

Please help me out of this issue. Appreciate your help.



via vijayP

No comments:

Post a Comment