Discussion:
[nodejs] Debugging Gulp fails in Chrome
r***@gmail.com
2018-10-24 22:31:25 UTC
Permalink
Hi,
I have followed the article
(https://stackoverflow.com/questions/40033298/how-to-debug-a-gulp-task) to
debug gulp file using chrome. My gulpfile.js looks like this:
var gulp = require('gulp');
// Gulp 4
debugger;
gulp.task('cleanTemp', function (done) {
console.log('Hello world!');
done();
});

When I execute the command from my working folder:
node --inspect-brk ./node_modules/gulp/node_modules/.bin/gulp cleanTemp

I am getting an error:
Debugger attached.
C:\Workspace\Projects\Eclipse\CommsProc\Source\HttpServer\node_modules\gulp\node_modules\.bin\gulp:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
^^^^^^^

SyntaxError: missing ) after argument list
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:617:28)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Function.Module.runMain (module.js:694:10)
at startup (bootstrap_node.js:204:16)
at bootstrap_node.js:625:3
Waiting for the debugger to disconnect...

What am I doing wrong. What does this message mean: basedir=$(dirname
"$(echo "$0" | sed -e 's,\\,/,g')")

Kind Regards,
Janusz
--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/1c0087ea-0832-44c4-8ddb-d1a2b3c2d167%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Rashik Ansar Shaik
2018-10-27 14:39:37 UTC
Permalink
i think its __dirname
Hi,
I have followed the article (
https://stackoverflow.com/questions/40033298/how-to-debug-a-gulp-task) to
var gulp = require('gulp');
// Gulp 4
debugger;
gulp.task('cleanTemp', function (done) {
console.log('Hello world!');
done();
});
node --inspect-brk ./node_modules/gulp/node_modules/.bin/gulp cleanTemp
Debugger attached.
C:\Workspace\Projects\Eclipse\CommsProc\Source\HttpServer\node_modules\gulp\node_modules\.bin\gulp:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:617:28)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Function.Module.runMain (module.js:694:10)
at startup (bootstrap_node.js:204:16)
at bootstrap_node.js:625:3
Waiting for the debugger to disconnect...
What am I doing wrong. What does this message mean: basedir=$(dirname
"$(echo "$0" | sed -e 's,\\,/,g')")
Kind Regards,
Janusz
--
Job board: http://jobs.nodejs.org/
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/1c0087ea-0832-44c4-8ddb-d1a2b3c2d167%40googlegroups.com
<https://groups.google.com/d/msgid/nodejs/1c0087ea-0832-44c4-8ddb-d1a2b3c2d167%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/CAJ4JZzLMX4j4vo%2B9k%3DpTcRHYEA3rUbEoAEb%2BcsUSwLq5cB9PmA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
r***@gmail.com
2018-10-30 22:50:42 UTC
Permalink
Yeah. But what about dirname. Any solution?

Kind Regards,
Janusz
Hi,
I have followed the article (
https://stackoverflow.com/questions/40033298/how-to-debug-a-gulp-task) to
var gulp = require('gulp');
// Gulp 4
debugger;
gulp.task('cleanTemp', function (done) {
console.log('Hello world!');
done();
});
node --inspect-brk ./node_modules/gulp/node_modules/.bin/gulp cleanTemp
Debugger attached.
C:\Workspace\Projects\Eclipse\CommsProc\Source\HttpServer\node_modules\gulp\node_modules\.bin\gulp:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:617:28)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Function.Module.runMain (module.js:694:10)
at startup (bootstrap_node.js:204:16)
at bootstrap_node.js:625:3
Waiting for the debugger to disconnect...
What am I doing wrong. What does this message mean: basedir=$(dirname
"$(echo "$0" | sed -e 's,\\,/,g')")
Kind Regards,
Janusz
--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/8de2656f-0e47-40a2-bf61-300fe2e5fc29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...