无法在node.js中使用模板字符串

Ele*_*fee 7 javascript node.js template-strings

根据MDN的说法,Template Strings 应该在Chrome中运行,并且扩展为Node.js所基于的V8; 但是当我尝试以下操作时出现语法错误:

var name = 'coffee';
console.log(`Hello, ${name}!`);
Run Code Online (Sandbox Code Playgroud)

运行node file.js只是结果SyntaxError: Unexpected token ILLEGAL

我需要启用某种标志才能使用此功能,还是只是在节点中没有实现?

T.J*_*der 19

NodeJS v4.0.0中添加了模板字符串.我可以确认它们至少可以在v4.1.1中发挥作用; 我没有费心去检查v4.0.0,但我没有理由怀疑链接的公告.不需要特殊的运行时标志.