我的node 版本是v0.10.18,最近在做grunt-teamcity-deploy的相关工作。期间在借助node-inspector 调试时遇到如下问题, 请各位大侠帮忙解决,谢谢! 错误:
$ node --debug-brk $(which grunt) deploy:development:dev
debugger listening on port 5858
c:\Users\AppData\Roaming\npm\grunt:2
basedir=`dirname "$0"`
^
SyntaxError: Unexpected token ILLEGAL
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain [as _onTimeout] (module.js:497:10)
at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
grunt脚本:
#!/bin/sh
basedir=`dirname "$0"`
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/node_modules/grunt-cli/bin/grunt" "$@"
ret=$?
else
node "$basedir/node_modules/grunt-cli/bin/grunt" "$@"
ret=$?
fi
exit $ret
坐等各位大侠解答
@jiyinyiyong 这个grunt脚本是自动生成的,不是我自己写的。如果需要用ES6的语法的话,nodejs 是不是要继续添加包啊? 谢谢!
坐等各位高手给出解答!
@jiyinyiyong LZ 在尝试用 node 的引擎运行一个 shell 脚本……
@ChiChou @jiyinyiyong 我尝试了一下,需要升级node的版本最低到0.11.6 ,我在升级的过程中遇到了新的问题。使用nvm升级但是貌似不起作用
$ nvm ls
-> system
$ nvm install stable
grep: invalid option – o
Usage: grep [OPTION]… PATTERN [FILE]…
Try grep --help' for more information. grep: invalid option -- o Usage: grep [OPTION]... PATTERN [FILE]... Try
grep --help’ for more information.
grep: invalid option – o
Usage: grep [OPTION]… PATTERN [FILE]…
Try grep --help' for more information. Version 'stable' not found - try
nvm ls-remote` to browse available versions.
$ nvm ls-remote grep: invalid option – o Usage: grep [OPTION]… PATTERN [FILE]… Try `grep --help’ for more information. iojs-v1.0.0 iojs-v1.0.1 iojs-v1.0.2 iojs-v1.0.3 iojs-v1.0.4
把which gulp 换成具体的啊 xxx/node_modules/gulp/bin/gulp
xxx 在win上是AppData/Roming/npm
看成gulp了。。。