gulpchild-processspawncwd

Error happened while child-process was executing command task with gulp-run


Task in gulpfile.js like this,

gulpfile.js

Error message from running gulp as below,

running gulp

i am sure jsdoc package is installed in the folder, because i could run the command successful manually,

manual run

my node.js version is 6.11.0

gulp local version is 3.9.1

jsdoc version is 3.5.5

the question is why the child-process was finding jsdoc conf.json under System folder instead of current working directory? is it an issue in gulp? what can i do to resolve it?

appreciate for your help!


Solution

  • the root cause is gulp-run use "cmd.exe /c jsdoc -c jsdoc/conf.json" for running in the child process if system is windows, system will find the file in the default directory if not assign, cwd parameter does not work.

    the temporary solution i use is assigning the detailed path to the folder, like c:\d1\d2\conf.json, conf.json file is also modified if needed, then the error is gone.

    details refer to the link - https://github.com/gulpjs/gulp/issues/2400