console.log('\033[33m[' + myDate.toLocaleTimeString() + ']\033[0m '+'新用户[ID '+mine.uid+']登记成功');
console.log时想要文字带上色彩,所以033[33m[这样的代码,但增加babel组件使用自动转换,启动时提示在这里报错
只能暂时再加一条斜杠先让程序跑起来,但命令行中色彩效果全没了。
console.log('\\033[33m[' + myDate.toLocaleTimeString() + ']\\033[0m '+'新用户[ID '+mine.uid+']登记成功');
迷茫2017-04-17 15:52:22
No one invited me, I came by myself. . . .
This problem should be regarded as a relatively niche problem. I happened to encounter it before when doing color output. At that time, it was not a problem caused by babel conversion, but the strict mode enabled by nodejs node --use-strict code>problem.
node --use-strict
出的问题。
把033
换成x1b
033
with x1b
🎜
console.log('\x1b[33m 23333');