我想使用 node debug
来单步执行 gulp 任务。
我尝试过以下方法:
node debug $(which gulp) protractor --specs=foo/foo-spec.js
但我收到以下错误:
< debugger listening on port 5858
connecting... ok
< c:\nodejs\node0.10.37-npm1.4.16-bower1.3.50-gruntcli0.1.13\gulp:2
< basedir=`dirname "$0"`
< ^
< SyntaxError: Unexpected token ILLEGAL
< at Module._compile (module.js:439:25)
任何人都可以帮助我理解为什么我可能会看到此错误吗?
我在 Windows 7 上使用 git bash。
最佳答案
您正在使用 Node 0.10.x 并且您的脚本包含 template string ,这是 ES6 的一项新功能。我相信 Node 0.10.x 需要 --harmony
标志来启用模板字符串(不确定 Node 0.12.x,但 io.js 默认启用此功能)。
尽管如此,您的问题似乎表明您仅在使用 node debug
时遇到此问题,但没有 debug
则不会出现此问题?如果是这样,那就真的很奇怪了,我希望它在这两种情况下都失败。
关于javascript - 调试 Protractor ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31938342/