我对节点很新。我只是设置快递和babel,我目前正在快递Hello World工作。我在app.js
的第一行是babel的require语句:
require("babel-core").transform("code", options);
产生错误:
ReferenceError: options is not defined
在我的.babelrc
中,我有这个:
{
"retainLines": true,
"compact": true,
"comments": false,
"stage": 1,
"whitelist": [
"es6.arrowFunctions",
"es6.blockScoping",
"es6.classes",
"es6.destructuring",
"es6.properties.computed",
"es6.properties.shorthand",
"es6.spread",
"es6.modules",
"es6.templateLiterals",
"es7.trailingFunctionCommas",
"es7.objectRestSpread",
"es7.asyncFunctions",
"es7.classProperties",
"regenerator",
"flow",
"react",
"react.displayName"
],
"sourceMaps": false
}
我根据docs设置了babel。我确定我错过了一些小东西,但是我搜索过,找不到有关此问题的任何信息。提前谢谢!