'gulp
[在我的gulp文件中要求gulp-babel
时,在我的js文件中使用es6
语法时出现错误。
/home/logakrishnan/Documents/project/node_modules/@babel/core/lib/transformation/file/file.js:77
constructor(options, {
^
SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/home/logakrishnan/Documents/project/node_modules/@babel/core/lib/index.js:153:36)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
节点版本:v4.4.7
您将必须升级您的Node.js版本。 (节点4是从2016开始的,相对而言JavaScript而言是永恒的。)
At the time of writing, Babel requires Node 6.9 or newer.