【发布时间】:2015-11-27 14:12:06
【问题描述】:
我正在尝试运行 node.js 后端服务器。我在 Node.js 文件中导入时收到错误 unexpected reserved word。
文件core.module.js 中的行是:
'use strict';
import lodashMixins from './lodashMixins.js'
... other imports and configurations ...
我启动简单命令:node core.module.js
这种错误并不少见,但通常发生在其他库中。我还没有看到 Node.js 的解决方案。我应该如何解决这个问题?我正在使用 Windows Server。
编辑:我发现它是 ES6,但我该如何启动它?它看起来像是应用程序的后端,但我不知道应该使用什么命令来启动它而不会出错。
【问题讨论】:
-
你可以使用
babel之类的东西。一个相关问题link
标签: javascript node.js ecmascript-6 importerror